Class VectorMath



  • public class VectorMath
    extends Object
    Functions for performing vector mathematics.
    • Constructor Detail

      • VectorMath

        public VectorMath()
    • Method Detail

      • normalToTriangle

        public static Coordinate normalToTriangle(Coordinate p0,
                                                  Coordinate p1,
                                                  Coordinate p2)
        Computes the normal vector to the triangle p0-p1-p2. In order to compute the normal each triangle coordinate must have a Z value. If this is not the case, the returned Coordinate will have NaN values. The returned vector has unit length.
        Parameters:
        p0 -
        p1 -
        p2 -
        Returns:
      • normalize

        public static void normalize(Coordinate v)
      • det

        public static double det(double a1,
                                 double a2,
                                 double b1,
                                 double b2)