Class EDistance

java.lang.Object
de.florianmichael.rclasses.math.geometry.EDistance

public class EDistance extends Object
Implementation of the Euclidean distance.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    distance(double x1, double y1, double x2, double y2)
    Calculates the distance between two points.
    static double
    distance(double x1, double y1, double z1, double x2, double y2, double z2)
    Calculates the distance between two points in 3D space.
    static float
    distance(float x1, float y1, float x2, float y2)
    Calculates the distance between two points.
    static float
    distance(float x1, float y1, float z1, float x2, float y2, float z2)
    Calculates the distance between two points in 3D space.
    static double
    squaredDistance(double x1, double y1, double x2, double y2)
    Calculates the squared distance between two points.
    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.
    static float
    squaredDistance(float x1, float y1, float x2, float y2)
    Calculates the squared distance between two points.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.