Here you can find the source of computeEuclideanDistance(Point2D point1, Point2D point2)
Parameter | Description |
---|---|
point1 | Point 1 |
point2 | Point 2 |
public static double computeEuclideanDistance(Point2D point1, Point2D point2)
//package com.java2s; /******************************************************************************* Copyright (c) 2016 Pablo Pavon-Marino. All rights reserved. This program and the accompanying materials are made available under the terms of the GNU Lesser Public License v2.1 which accompanies this distribution, and is available at http://www.gnu.org/licenses/lgpl.html * /*from w w w .ja va2 s.c o m*/ * Contributors: Pablo Pavon-Marino - Jose-Luis Izquierdo-Zaragoza, up to version 0.3.1 Pablo Pavon-Marino - from version 0.4.0 onwards ******************************************************************************/ import java.awt.geom.Point2D; public class Main { /** Computes the Euclidean distance between two points. * * @param point1 Point 1 * @param point2 Point 2 * @return Euclidean distance between two points */ public static double computeEuclideanDistance(Point2D point1, Point2D point2) { return point1.distance(point2); } }