/** * @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); }
/** * @param vec * @return the dot product of this vector with the x, y values of the given vector. * @throws NullPointerException * if vec is null. */ @Override public double dot(final ReadOnlyVector2 vec) { return dot(vec.getX(), vec.getY()); }
/** * @param vec * @return the dot product of this vector with the x, y values of the given vector. * @throws NullPointerException * if vec is null. */ @Override public double dot(final ReadOnlyVector2 vec) { return dot(vec.getX(), vec.getY()); }