Java Distance Calculate distance(final double x1, final double y1, final double x2, final double y2)

Here you can find the source of distance(final double x1, final double y1, final double x2, final double y2)

Description

distance

License

Open Source License

Declaration

public static Double distance(final double x1, final double y1, final double x2, final double y2) 

Method Source Code

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

public class Main {
    public static Double distance(final double x1, final double y1, final double x2, final double y2) {
        final double dx = Math.max(x1, x2) - Math.min(x1, x2);
        final double dy = Math.max(y1, y2) - Math.min(y1, y2);
        return Math.sqrt(dx * dx + dy * dy);
    }//  w  ww .  ja v a  2 s .c o m
}

Related

  1. distance(double[] p1, double[] p2)
  2. distance(double[] x, int p, int q, int dim)
  3. distance(final Class child, final Class parent)
  4. distance(final double x, final double y)
  5. distance(final double x1, final double y1, final double x2, final double y2)
  6. distance(final double[] a, final double[] b)
  7. Distance(final double[] minCorner, final double[] maxCorner)
  8. distance(final double[] p, final double[] q)
  9. distance(final double[] t1, final double[] t2)