/** {@inheritDoc} */ public double value(double x) { return FastMath.asin(x); }
/** {@inheritDoc} * @since 3.2 */ public Decimal64 asin() { return new Decimal64(FastMath.asin(value)); }
/** Get the elevation of the vector. * @return elevation (δ) of the vector, between -π/2 and +π/2 * @see #Vector3D(double, double) */ public double getDelta() { return FastMath.asin(z / getNorm()); }
/** {@inheritDoc} */ public SparseGradient asin() { return new SparseGradient(FastMath.asin(value), 1.0 / FastMath.sqrt(1 - value * value), derivatives); }
/** Get the angle of the rotation. * @return angle of the rotation (between 0 and π) * @see #Rotation(Vector3D, double) */ public double getAngle() { if ((q0 < -0.1) || (q0 > 0.1)) { return 2 * FastMath.asin(FastMath.sqrt(q1 * q1 + q2 * q2 + q3 * q3)); } else if (q0 < 0) { return 2 * FastMath.acos(-q0); } return 2 * FastMath.acos(q0); }
function[0] = FastMath.asin(x); if (order > 0) {
double crossTrackError(Coordinate coord) { double distanceFromStart = SphericalDistanceLibrary.fastDistance(start, coord); double bearingToCoord = bearing(start, coord); double bearingToEnd = bearing(start, end); return FastMath.asin(FastMath.sin(distanceFromStart / RADIUS) * FastMath.sin(bearingToCoord - bearingToEnd)) * RADIUS; }
/** Compute the angular separation between two vectors. * <p>This method computes the angular separation between two * vectors using the dot product for well separated vectors and the * cross product for almost aligned vectors. This allows to have a * good accuracy in all cases, even for vectors very close to each * other.</p> * @param v1 first vector * @param v2 second vector * @return angular separation between v1 and v2 * @exception MathArithmeticException if either vector has a null norm */ public static double angle(Vector2D v1, Vector2D v2) throws MathArithmeticException { double normProduct = v1.getNorm() * v2.getNorm(); if (normProduct == 0) { throw new MathArithmeticException(LocalizedFormats.ZERO_NORM); } double dot = v1.dotProduct(v2); double threshold = normProduct * 0.9999; if ((dot < -threshold) || (dot > threshold)) { // the vectors are almost aligned, compute using the sine final double n = FastMath.abs(MathArrays.linearCombination(v1.x, v2.y, -v1.y, v2.x)); if (dot >= 0) { return FastMath.asin(n / normProduct); } return FastMath.PI - FastMath.asin(n / normProduct); } // the vectors are sufficiently separated to use the cosine return FastMath.acos(dot / normProduct); }
/** Compute the angular separation between two vectors. * <p>This method computes the angular separation between two * vectors using the dot product for well separated vectors and the * cross product for almost aligned vectors. This allows to have a * good accuracy in all cases, even for vectors very close to each * other.</p> * @param v1 first vector * @param v2 second vector * @return angular separation between v1 and v2 * @exception MathArithmeticException if either vector has a null norm */ public static double angle(Vector3D v1, Vector3D v2) throws MathArithmeticException { double normProduct = v1.getNorm() * v2.getNorm(); if (normProduct == 0) { throw new MathArithmeticException(LocalizedFormats.ZERO_NORM); } double dot = v1.dotProduct(v2); double threshold = normProduct * 0.9999; if ((dot < -threshold) || (dot > threshold)) { // the vectors are almost aligned, compute using the sine Vector3D v3 = crossProduct(v1, v2); if (dot >= 0) { return FastMath.asin(v3.getNorm() / normProduct); } return FastMath.PI - FastMath.asin(v3.getNorm() / normProduct); } // the vectors are sufficiently separated to use the cosine return FastMath.acos(dot / normProduct); }
FastMath.asin(v2.getZ()), FastMath.atan2(-(v2.getY()), v2.getX()) }; -FastMath.asin(v2.getY()), FastMath.atan2(v2.getZ(), v2.getX()) }; -FastMath.asin(v2.getZ()), FastMath.atan2(v2.getX(), v2.getY()) }; FastMath.asin(v2.getX()), FastMath.atan2(-(v2.getZ()), v2.getY()) }; FastMath.asin(v2.getY()), FastMath.atan2(-(v2.getX()), v2.getZ()) }; -FastMath.asin(v2.getX()), FastMath.atan2(v2.getY(), v2.getZ()) }; FastMath.asin(v2.getX()), FastMath.atan2(-v1.getY(), v1.getX()) }; -FastMath.asin(v2.getX()),
@Override public double op(double origin) { return FastMath.asin(origin); }
/** {@inheritDoc} * @since 3.2 */ public Decimal64 asin() { return new Decimal64(FastMath.asin(value)); }
/** Get the elevation of the vector. * @return elevation (δ) of the vector, between -π/2 and +π/2 * @see #Vector3D(double, double) */ public double getDelta() { return FastMath.asin(z / getNorm()); }
public double evalD(final EvalEnv env, final Term[] args) { return FastMath.asin(args[0].evalD(env)); } });
@Override public void run() { for (long k = firstIdx; k < lastIdx; k++) { res.setDouble(k, FastMath.asin(a.getDouble(k))); } } });
/** {@inheritDoc} */ public SparseGradient asin() { return new SparseGradient(FastMath.asin(value), 1.0 / FastMath.sqrt(1 - value * value), derivatives); }
/** Get the angle of the rotation. * @return angle of the rotation (between 0 and π) * @see #Rotation(Vector3D, double) */ public double getAngle() { if ((q0 < -0.1) || (q0 > 0.1)) { return 2 * FastMath.asin(FastMath.sqrt(q1 * q1 + q2 * q2 + q3 * q3)); } else if (q0 < 0) { return 2 * FastMath.acos(-q0); } return 2 * FastMath.acos(q0); }
private static double computeEarthRadius(final double senPosZ, final double satelliteHeight) { final double re = Constants.semiMajorAxis; final double rp = Constants.semiMinorAxis; final double lat = FastMath.asin(senPosZ / satelliteHeight); return (re * rp) / Math.sqrt(rp * rp * FastMath.cos(lat) * FastMath.cos(lat) + re * re * FastMath.sin(lat) * FastMath.sin(lat)); }
@Test public void testMathASinFast() { for (double i = 0; i < numItr; ++i) { double val = FastMath.asin(i); } }
public ValueType asin(CalculatedValue g) { if (g.isComplex()) { return setComplexValue(g.getComplex().asin()); } else { return setValue(FastMath.asin(g.real)); } }