Java Distance between Point and Line getDistance(double aX, double aY, double bX, double bY)

Here you can find the source of getDistance(double aX, double aY, double bX, double bY)

Description

get Distance

License

Open Source License

Declaration

public static double getDistance(double aX, double aY, double bX, double bY) 

Method Source Code


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

import java.awt.geom.Point2D;

public class Main {
    public static double getDistance(double aX, double aY, double bX, double bY) {
        return Math.abs(Math.sqrt(Math.pow(aX - bX, 2) + Math.pow(aY - bY, 2)));
    }// ww w  .  jav  a 2 s . c  o m

    public static double getDistance(Point2D.Double a, Point2D.Double b) {
        return getDistance(a.x, a.y, b.x, b.y);
    }
}

Related

  1. distancePointToLine(final Point2D point, final Line2D line)
  2. DistanceToLine(double x, double y, double x1, double y1, double x2, double y2)
  3. distanceToLine(Point2D p, Point2D endA, Point2D endZ)
  4. distanceToLine2(Line2D l, Point2D p)
  5. distanceToLine3(Line2D l, Point2D p)
  6. getDistance(Line2D aSegment, Point aPoint)
  7. getDistanceToCenter(Point2D p, Line2D line)