Here you can find the source of getDistance(Point2D point1, Point2D point2)
Parameter | Description |
---|---|
point1 | the first point. |
point2 | the second point. |
public static double getDistance(Point2D point1, Point2D point2)
//package com.java2s; //License from project: Open Source License import java.awt.geom.Point2D; public class Main { /**//w w w .j av a 2 s.co m * Gets the distance between two points. * * @param point1 the first point. * @param point2 the second point. * @return distance (meters). */ public static double getDistance(Point2D point1, Point2D point2) { return Point2D.Double.distance(point1.getX(), point1.getY(), point2.getX(), point2.getY()); } }