Class EDistance
java.lang.Object
de.florianmichael.rclasses.math.geometry.EDistance
Implementation of the Euclidean distance.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doubledistance(double x1, double y1, double x2, double y2) Calculates the distance between two points.static doubledistance(double x1, double y1, double z1, double x2, double y2, double z2) Calculates the distance between two points in 3D space.static floatdistance(float x1, float y1, float x2, float y2) Calculates the distance between two points.static floatdistance(float x1, float y1, float z1, float x2, float y2, float z2) Calculates the distance between two points in 3D space.static doublesquaredDistance(double x1, double y1, double x2, double y2) Calculates the squared distance between two points.static doublesquaredDistance(double x1, double y1, double z1, double x2, double y2, double z2) Calculates the squared distance between two points in 3D space.static floatsquaredDistance(float x1, float y1, float x2, float y2) Calculates the squared distance between two points.static floatsquaredDistance(float x1, float y1, float z1, float x2, float y2, float z2) Calculates the squared distance between two points in 3D space.
-
Constructor Details
-
EDistance
public EDistance()
-
-
Method Details
-
distance
public static float distance(float x1, float y1, float x2, float y2) Calculates the distance between two points.- Parameters:
x1- The x coordinate of the first point.y1- The y coordinate of the first point.x2- The x coordinate of the second point.y2- The y coordinate of the second point.- Returns:
- The distance between the two points.
-
squaredDistance
public static float squaredDistance(float x1, float y1, float x2, float y2) Calculates the squared distance between two points.- Parameters:
x1- The x coordinate of the first point.y1- The y coordinate of the first point.x2- The x coordinate of the second point.y2- The y coordinate of the second point.- Returns:
- The squared distance between the two points.
-
distance
public static float distance(float x1, float y1, float z1, float x2, float y2, float z2) Calculates the distance between two points in 3D space.- Parameters:
x1- The x coordinate of the first point.y1- The y coordinate of the first point.z1- The z coordinate of the first point.x2- The x coordinate of the second point.y2- The y coordinate of the second point.z2- The z coordinate of the second point.- Returns:
- The distance between the two points.
-
squaredDistance
public static float squaredDistance(float x1, float y1, float z1, float x2, float y2, float z2) Calculates the squared distance between two points in 3D space.- Parameters:
x1- The x coordinate of the first point.y1- The y coordinate of the first point.z1- The z coordinate of the first point.x2- The x coordinate of the second point.y2- The y coordinate of the second point.z2- The z coordinate of the second point.- Returns:
- The squared distance between the two points.
-
distance
public static double distance(double x1, double y1, double x2, double y2) Calculates the distance between two points.- Parameters:
x1- The x coordinate of the first point.y1- The y coordinate of the first point.x2- The x coordinate of the second point.y2- The y coordinate of the second point.- Returns:
- The distance between the two points.
-
squaredDistance
public static double squaredDistance(double x1, double y1, double x2, double y2) Calculates the squared distance between two points.- Parameters:
x1- The x coordinate of the first point.y1- The y coordinate of the first point.x2- The x coordinate of the second point.y2- The y coordinate of the second point.- Returns:
- The squared distance between the two points.
-
distance
public static double distance(double x1, double y1, double z1, double x2, double y2, double z2) Calculates the distance between two points in 3D space.- Parameters:
x1- The x coordinate of the first point.y1- The y coordinate of the first point.z1- The z coordinate of the first point.x2- The x coordinate of the second point.y2- The y coordinate of the second point.z2- The z coordinate of the second point.- Returns:
- The distance between the two points.
-
squaredDistance
public static double squaredDistance(double x1, double y1, double z1, double x2, double y2, double z2) Calculates the squared distance between two points in 3D space.- Parameters:
x1- The x coordinate of the first point.y1- The y coordinate of the first point.z1- The z coordinate of the first point.x2- The x coordinate of the second point.y2- The y coordinate of the second point.z2- The z coordinate of the second point.- Returns:
- The squared distance between the two points.
-