Class SpatialMath

java.lang.Object
com.eco.bio7.spatial.SpatialMath

public class SpatialMath extends Object
This class offers some utility math methods.
  • Constructor Details

    • SpatialMath

      public SpatialMath()
  • Method Details

    • calculateNormal

      public static float[] calculateNormal(float[] v1, float[] v2, float[] v3)
      This method calculates the normal from three vertices.
      Parameters:
      v1 - vector1 as a float array
      v2 - vector 2 as a float array
      v3 - vector 3 as a float array
      Returns:
      a float array representing the normal
    • normalize

      public static float[] normalize(float[] normal)
      This method normalizes a vector.
      Parameters:
      normal - a float array
      Returns:
      the normalized vector.
    • euclideanDistance

      public static float euclideanDistance(float[] vector1, float[] vector2)
      Calculates the euclidean distance between two points.
      Parameters:
      vector1 - a float array with the coordinates.
      vector2 - a float array with the coordinates.
      Returns:
      the distance of two points.