Java Geometry Algorithm computeEuclideanDistance(Point2D point1, Point2D point2)

Here you can find the source of computeEuclideanDistance(Point2D point1, Point2D point2)

Description

Computes the Euclidean distance between two points.

License

LGPL

Parameter

Parameter Description
point1 Point 1
point2 Point 2

Return

Euclidean distance between two points

Declaration

public static double computeEuclideanDistance(Point2D point1, Point2D point2) 

Method Source Code

//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);
    }
}

Related

  1. cleanList(List blueList, Polygon borders)
  2. colinearPoint(Line2D line, Point2D point, double distance)
  3. computeAngleDEG(@Nonnull Point2D p1, @Nonnull Point2D p2)
  4. computeAngleRAD(@Nonnull Point2D p)
  5. computeBarycenter(Map values)
  6. computePolygonArea(Point2D[] pts)
  7. coordinateSplit(Point2D.Double[] aPoints, double[] aX, double[] aY)
  8. cornersToWorldFile(Point2D[] esq, Dimension size)
  9. curvedLineHit(Point point, Point startPoint, Point endPoint, Point controlPoint1, Point controlPoint2, float padding)