/** {@inheritDoc} */ @Override public double value(double x, double y) { return FastMath.atan2(x, y); } };
/** Get the azimuth of the vector. * @return azimuth (α) of the vector, between -π and +π * @see #Vector3D(double, double) */ public double getAlpha() { return FastMath.atan2(y, x); }
/** * <p>Compute the argument of this complex number. * </p> * <p>The argument is the angle phi between the positive real axis and the point * representing this number in the complex plane. The value returned is between -PI (not inclusive) * and PI (inclusive), with negative values returned for numbers with negative imaginary parts. * </p> * <p>If either real or imaginary part (or both) is NaN, NaN is returned. Infinite parts are handled * as java.Math.atan2 handles them, essentially treating finite parts as zero in the presence of * an infinite coordinate and returning a multiple of pi/4 depending on the signs of the infinite * parts. See the javadoc for java.Math.atan2 for full details.</p> * * @return the argument of this complex number */ public double getArgument() { return FastMath.atan2(getImaginary(), getReal()); }
FastMath.atan2(imaginary, real));
/** Estimate a first guess of the φ coefficient. */ private void guessPhi() { // initialize the means double fcMean = 0.0; double fsMean = 0.0; double currentX = observations[0].getX(); double currentY = observations[0].getY(); for (int i = 1; i < observations.length; ++i) { // one step forward final double previousX = currentX; final double previousY = currentY; currentX = observations[i].getX(); currentY = observations[i].getY(); final double currentYPrime = (currentY - previousY) / (currentX - previousX); double omegaX = omega * currentX; double cosine = FastMath.cos(omegaX); double sine = FastMath.sin(omegaX); fcMean += omega * currentY * cosine - currentYPrime * sine; fsMean += omega * currentY * sine + currentYPrime * cosine; } phi = FastMath.atan2(-fsMean, fcMean); }
FastMath.atan2(-(v1.getY()), v1.getZ()), FastMath.asin(v2.getZ()), FastMath.atan2(-(v2.getY()), v2.getX()) }; FastMath.atan2(v1.getZ(), v1.getY()), -FastMath.asin(v2.getY()), FastMath.atan2(v2.getZ(), v2.getX()) }; FastMath.atan2(v1.getX(), v1.getZ()), -FastMath.asin(v2.getZ()), FastMath.atan2(v2.getX(), v2.getY()) }; FastMath.atan2(-(v1.getZ()), v1.getX()), FastMath.asin(v2.getX()), FastMath.atan2(-(v2.getZ()), v2.getY()) }; FastMath.atan2(-(v1.getX()), v1.getY()), FastMath.asin(v2.getY()), FastMath.atan2(-(v2.getX()), v2.getZ()) }; FastMath.atan2(v1.getY(), v1.getX()), -FastMath.asin(v2.getX()), FastMath.atan2(v2.getY(), v2.getZ()) };