Java Distance between Points distance(@Nonnull Point2D pA, @Nonnull Point2D pB)

Here you can find the source of distance(@Nonnull Point2D pA, @Nonnull Point2D pB)

Description

calculate the distance between two points

License

Open Source License

Parameter

Parameter Description
pA the first point
pB the second point

Return

the distance between the two points

Declaration

@CheckReturnValue
public static double distance(@Nonnull Point2D pA, @Nonnull Point2D pB) 

Method Source Code

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

import java.awt.geom.Point2D;

import javax.annotation.CheckReturnValue;
import javax.annotation.Nonnull;

public class Main {
    /**/*from  ww w  . j  a  v a2 s  .c  o m*/
     * calculate the distance between two points
     *
     * @param pA the first point
     * @param pB the second point
     * @return the distance between the two points
     */
    @CheckReturnValue
    public static double distance(@Nonnull Point2D pA, @Nonnull Point2D pB) {
        return pA.distance(pB);
    }
}

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)