Class CosAngle


  • public final class CosAngle
    extends java.lang.Object
    Computes the cosine of the angle between two vectors.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private CosAngle()
      Private constructor.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static double value​(double[] v1, double[] v2)
      Computes the cosine of the angle between v1 and v2.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CosAngle

        private CosAngle()
        Private constructor.
    • Method Detail

      • value

        public static double value​(double[] v1,
                                   double[] v2)
        Computes the cosine of the angle between v1 and v2.
        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:
        java.lang.IllegalArgumentException - if the sizes of the input arrays are different