|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.graphics.DistanceOperations
Implementations of various distance algorithms.
Notice that the method for computing the distance from a point to a line-segment will return the minimum distance of the two.
MathDynamicException| Method Summary | |
static double |
distancePointToLine(double x0,
double y0,
double x1,
double y1,
double x2,
double y2)
Computes the distance between a (infinite) line and a point. |
static double |
distancePointToLineSegment(double x0,
double y0,
double x1,
double y1,
double x2,
double y2)
Computes the distance between a line segment and a point. |
static double |
distancePointToPoint(Coordinate a,
Coordinate b)
Computes the distance between two Coordinates. |
static double |
distancePointToPoint(double x1,
double y1,
double x2,
double y2)
Computes the distance between a line segment and a point. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static final double distancePointToPoint(double x1,
double y1,
double x2,
double y2)
MathDynamicException is thrown.
x1 - the x component of the start point.y1 - the y component of the start point.x2 - the x component of the end point.y2 - the y component of the end point.
public static final double distancePointToPoint(Coordinate a,
Coordinate b)
Coordinates. The two given
Coordinates must have the same number of components.
a - the first coordinate.b - the second coordinate.
public static final double distancePointToLine(double x0,
double y0,
double x1,
double y1,
double x2,
double y2)
MathDynamicException is thrown.
x0 - the x component of the point.y0 - the y component of the point.x1 - the x component of the start of the line.y1 - the y component of the start of the line.x2 - the x component of the end of the line.y2 - the y component of the end of the line.
MathDynamicException, - if x2-x1 or y2-y1 is zero.
public static final double distancePointToLineSegment(double x0,
double y0,
double x1,
double y1,
double x2,
double y2)
MathDynamicException is thrown.
x0 - the x component of the point.y0 - the y component of the point.x1 - the x component of the start of the line segment.y1 - the y component of the start of the line segment.x2 - the x component of the end of the line segment.y2 - the y component of the end of the line segment.
MathDynamicException, - if x1-x0, x2-x1, y2-y1 or
y1-y0 is zero.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||