com.savarese.spatial
Class EuclideanDistance<Coord extends java.lang.Number & java.lang.Comparable<? super Coord>,P extends Point<Coord>>
java.lang.Object
com.savarese.spatial.EuclideanDistance<Coord,P>
- All Implemented Interfaces:
- Distance<Coord,P>
public class EuclideanDistance<Coord extends java.lang.Number & java.lang.Comparable<? super Coord>,P extends Point<Coord>>
- extends java.lang.Object
- implements Distance<Coord,P>
The EuclideanDistance class determines the distance between two
points in a Euclidean space.
Method Summary |
double |
distance(P from,
P to)
Returns the euclidean distance between two points. |
double |
distance2(P from,
P to)
Returns the square of the euclidean distance between two points. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EuclideanDistance
public EuclideanDistance()
distance
public double distance(P from,
P to)
- Returns the euclidean distance between two points.
- Specified by:
distance
in interface Distance<Coord extends java.lang.Number & java.lang.Comparable<? super Coord>,P extends Point<Coord>>
- Parameters:
from
- The first end point.to
- The second end point.
- Returns:
- The distance between from and to.
distance2
public double distance2(P from,
P to)
- Returns the square of the euclidean distance between two points.
- Specified by:
distance2
in interface Distance<Coord extends java.lang.Number & java.lang.Comparable<? super Coord>,P extends Point<Coord>>
- Parameters:
from
- The first end point.to
- The second end point.
- Returns:
- The square of the euclidean distance between from and to.
Copyright © 2001-2005 Daniel F. Savarese
Copyright © 2006-2010 Savarese Software Research Corporation