Java Distance between Points getDistance(Point2D.Double pt1, Point2D.Double pt2)

Here you can find the source of getDistance(Point2D.Double pt1, Point2D.Double pt2)

Description

get Distance

License

Apache License

Declaration

public static double getDistance(Point2D.Double pt1, Point2D.Double pt2) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.awt.geom.Point2D;

public class Main {
    public static double getDistance(Point2D.Double pt1, Point2D.Double pt2) {
        double dx = pt2.x - pt1.x, dy = pt2.y - pt1.y;
        return Math.sqrt(dx * dx + dy * dy);
    }//  www  .jav  a  2  s  .  co  m
}

Related

  1. distance(final double p1X, final double p1Y, final double p2X, final double p2Y)
  2. distance(Point2D a, Point2D b)
  3. DistanceSquareToLine(double x, double y, double x1, double y1, double x2, double y2)
  4. getDistance(Point2D point1, Point2D point2)
  5. getDistance(Point2D point1, Point2D point2)