Class SpatialMath
java.lang.Object
com.eco.bio7.spatial.SpatialMath
This class offers some utility math methods.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic float[]calculateNormal(float[] v1, float[] v2, float[] v3) This method calculates the normal from three vertices.static floateuclideanDistance(float[] vector1, float[] vector2) Calculates the euclidean distance between two points.static float[]normalize(float[] normal) This method normalizes a vector.
-
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 arrayv2- vector 2 as a float arrayv3- 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.
-