/** * @param otherVector * a unit vector to find the angle against * @return the minimum angle (in radians) between two vectors. It is assumed that both this vector and the given * vector are unit vectors (normalized). * @throws NullPointerException * if otherVector is null. */ @Override public double smallestAngleBetween(final ReadOnlyVector3 otherVector) { return MathUtils.acos(dot(otherVector)); }
/** * @param otherVector * a unit vector to find the angle against * @return the minimum angle (in radians) between two vectors. It is assumed that both this vector and the given * vector are unit vectors (normalized). * @throws NullPointerException * if otherVector is null. */ @Override public double smallestAngleBetween(final ReadOnlyVector3 otherVector) { return MathUtils.acos(dot(otherVector)); }
/** * @param otherVector * a unit vector to find the angle against * @return the minimum angle (in radians) between two vectors. It is assumed that both this vector and the given * vector are unit vectors (normalized). * @throws NullPointerException * if otherVector is null. */ @Override public double smallestAngleBetween(final ReadOnlyVector2 otherVector) { final double dotProduct = dot(otherVector); return MathUtils.acos(dotProduct); }
/** * @param otherVector * a unit vector to find the angle against * @return the minimum angle (in radians) between two vectors. It is assumed that both this vector and the given * vector are unit vectors (normalized). * @throws NullPointerException * if otherVector is null. */ @Override public double smallestAngleBetween(final ReadOnlyVector2 otherVector) { final double dotProduct = dot(otherVector); return MathUtils.acos(dotProduct); }
final double theta = MathUtils.acos(result); final double invSinTheta = 1f / MathUtils.sin(theta);
final double theta = MathUtils.acos(result); final double invSinTheta = 1f / MathUtils.sin(theta);