Class CosAngle
java.lang.Object
org.apache.commons.numbers.angle.CosAngle
Computes the cosine of the angle between two vectors.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doublevalue(double[] v1, double[] v2) Computes the cosine of the angle betweenv1andv2.
-
Constructor Details
-
CosAngle
private CosAngle()Private constructor.
-
-
Method Details
-
value
public static double value(double[] v1, double[] v2) Computes the cosine of the angle betweenv1andv2.- Parameters:
v1- Cartesian coordinates of the first vector.v2- Cartesian coordinates of the second vector.- Returns:
- the cosine of the angle between the vectors.
- Throws:
IllegalArgumentException- if the sizes of the input arrays are different
-