Java Distance Calculate distance(double xOrigin, double yOrigin, double xDestination, double yDestination)

Here you can find the source of distance(double xOrigin, double yOrigin, double xDestination, double yDestination)

Description

distance

License

Open Source License

Declaration

public static double distance(double xOrigin, double yOrigin,
            double xDestination, double yDestination) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static double distance(double xOrigin, double yOrigin,
            double xDestination, double yDestination) {
        double offsetX = xDestination - xOrigin;
        double offsetY = yDestination - yOrigin;

        return Math.sqrt(offsetX * offsetX + offsetY * offsetY);
    }/*from  w w w  . j  a  va  2 s.co m*/
}

Related

  1. distance(double x0, double y0, double z0, double x1, double y1, double z1)
  2. distance(double x1, double y1, double x2, double y2)
  3. distance(double x1, double y1, double x2, double y2)
  4. distance(double x1, double y1, double x2, double y2)
  5. distance(double x1, double y1, double z1, double x2, double y2, double z2)
  6. distance(double[] a, double[] b)
  7. distance(double[] a, double[] b)
  8. distance(double[] p1, double[] p2)
  9. distance(double[] p1, double[] p2)