/** * Arcus secant - inverse trigonometric secant function * * @param a the a function parameter * @return Inverse trigonometric secant function */ public static final double asec(double a) { if (Double.isNaN(a)) return Double.NaN; double r = Math.acos(1/a); if (mXparser.checkIfDegreesMode()) return r / Units.DEGREE_ARC; else return r; } /**
/** * Sine trigonometric function * * @param a the a function parameter * * @return if a <> Double.NaN return Math.sin(a), * otherwise return Double.NaN. */ public static final double sin(double a) { if (Double.isNaN(a)) return Double.NaN; if (mXparser.checkIfDegreesMode()) a = a * Units.DEGREE_ARC; return Math.sin(a); } /**
/** * Tangent trigonometric function * * @param a the a function parameter * * @return if a <> Double.NaN returns Math.tan(a), * otherwise returns Double.NaN. */ public static final double tan(double a) { if (Double.isNaN(a)) return Double.NaN; if (mXparser.checkIfDegreesMode()) a = a * Units.DEGREE_ARC; return Math.tan(a); } /**
/** * Arcus cosecant - inverse trigonometric cosecant function * * @param a the a function parameter * @return Inverse trigonometric cosecant function */ public static final double acosec(double a) { if (Double.isNaN(a)) return Double.NaN; double r = Math.asin(1/a); if (mXparser.checkIfDegreesMode()) return r / Units.DEGREE_ARC; else return r; } /**
/** * Cosine trigonometric function * * @param a the a function parameter * * @return if a <> Double.NaN returns Math.cos(a), * otherwise returns Double.NaN. */ public static final double cos(double a) { if (Double.isNaN(a)) return Double.NaN; if (mXparser.checkIfDegreesMode()) a = a * Units.DEGREE_ARC; return Math.cos(a); } /**
/** * Arcus cosine - inverse trigonometric cosine function * * @param a the a function parameter * * @return if a <> Double.NaN returns Math.acos(a), * otherwise returns Double.NaN. */ public static final double acos(double a) { if (Double.isNaN(a)) return Double.NaN; double r = Math.acos(a); if (mXparser.checkIfDegreesMode()) return r / Units.DEGREE_ARC; else return r; } /**
/** * Arcus tangent - inverse trigonometric tangent function * * @param a the a function parameter * * @return if a <> Double.NaN returns Math.atan(a), * otherwise returns Double.NaN. */ public static final double atan(double a) { if (Double.isNaN(a)) return Double.NaN; double r = Math.atan(a); if (mXparser.checkIfDegreesMode()) return r / Units.DEGREE_ARC; else return r; } /**
/** * Arcus cotangent - inverse trigonometric cotangent function * * @param a the a function parameter * * @return if a <> Double.NaN and a <> 0 returns Math.atan(1/a), * otherwise returns Double.NaN. */ public static final double actan(double a) { if (Double.isNaN(a)) return Double.NaN; double r = Math.atan(1/a); if (mXparser.checkIfDegreesMode()) return r / Units.DEGREE_ARC; else return r; } /**
/** * Cotangent trigonometric function * * @param a the a function parameter * * @return if a <> Double.NaN and tan(a) <> 0 returns 1 / Math.tan(a), * otherwise returns Double.NaN. */ public static final double ctan(double a) { if (Double.isNaN(a)) return Double.NaN; if (mXparser.checkIfDegreesMode()) a = a * Units.DEGREE_ARC; double result = Double.NaN; double tg = Math.tan(a); if (tg != 0) result = 1.0 / tg; return result; } /**
/** * Arcus sine - inverse trigonometric sine function * * @param a the a function parameter * * @return if a <> Double.NaN returns Math.asin(a), * otherwise returns Double.NaN. */ public static final double asin(double a) { if (Double.isNaN(a)) return Double.NaN; double r = Math.asin(a); if (mXparser.checkIfDegreesMode()) return r / Units.DEGREE_ARC; else return r; } /**
/** * Cosecant trigonometric function * * @param a the a function parameter * * @return if a <> Double.NaN and sin(a) <> 0 returns 1 / Math.sin(a), * otherwise returns Double.NaN. */ public static final double cosec(double a) { if (Double.isNaN(a)) return Double.NaN; if (mXparser.checkIfDegreesMode()) a = a * Units.DEGREE_ARC; double result = Double.NaN; double sin = Math.sin(a); if (sin != 0) result = 1.0 / sin; return result; } /**
/** * Secant trigonometric function * * @param a the a function parameter * * @return if a <> Double.NaN and cos(a) <> 0 returns 1 / Math.cos(a), * otherwise returns Double.NaN. */ public static final double sec(double a) { if (Double.isNaN(a)) return Double.NaN; if (mXparser.checkIfDegreesMode()) a = a * Units.DEGREE_ARC; double result = Double.NaN; double cos = Math.cos(a); if (cos != 0) result = 1.0 / cos; return result; } /**
/** * Sinc function. * * @param a the a function parameter * * @return if a <> Double.NaN and a <> 0 returns Math.sin(a) / (a), * otherwise returns Double.NaN. */ public static final double sinc(double a) { if (Double.isNaN(a)) return Double.NaN; double result = Double.NaN; if (a != 0) if (mXparser.checkIfDegreesMode()) result = Math.sin(a * Units.DEGREE_ARC) / (a); else result = Math.sin(a) / (a); else result = 1.0; return result; } /**
if ( (mXparser.checkIfRadiansMode() == true) && (mXparser.checkIfDegreesMode() == false) ) test[testId] = true; if ( (mXparser.checkIfRadiansMode() == false) && (mXparser.checkIfDegreesMode() == true) ) test[testId] = true; if ( (mXparser.checkIfRadiansMode() == true) && (mXparser.checkIfDegreesMode() == false) ) test[testId] = true;