Savarese Software Research Corporation

com.savarese.spatial
Interface Distance<Coord extends java.lang.Number & java.lang.Comparable<? super Coord>,P extends Point<Coord>>

All Known Implementing Classes:
EuclideanDistance

public interface Distance<Coord extends java.lang.Number & java.lang.Comparable<? super Coord>,P extends Point<Coord>>

The Distance interface encapsulates an algorithm for determining the distance between two points.


Method Summary
 double distance(P from, P to)
          Returns the distance between two points.
 double distance2(P from, P to)
          Returns the square of the distance between two points.
 

Method Detail

distance

double distance(P from,
                P to)
Returns the distance between two points.

Parameters:
from - The first end point.
to - The second end point.
Returns:
The distance between from and to.

distance2

double distance2(P from,
                 P to)
Returns the square of the distance between two points.

Parameters:
from - The first end point.
to - The second end point.
Returns:
The square of the distance between from and to.

Savarese Software Research Corporation

Copyright © 2001-2005 Daniel F. Savarese
Copyright © 2006-2010 Savarese Software Research Corporation