|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Point2D<T extends java.lang.Number>
Interface for classes representing a point in a two-dimensional Cartesian plane.
Implementing classes should be immutable; hence, appropriate constructors should be supplied to allow coordinates to be specified at construction time.
Method Summary | |
---|---|
double |
distanceFromOrigin()
Returns the distance of this point from the origin. |
double |
distanceFromPoint(Point2D<T> thePoint)
Returns the distance between this point and the given point. |
T |
getX()
Returns x coordinate |
T |
getY()
Returns y coordinate |
Point2D<T> |
translateBy(GeometricVector<T> theVector)
Returns a new point at the coordinate translated from this point's position by the given vector |
Method Detail |
---|
Point2D<T> translateBy(GeometricVector<T> theVector)
theVector
- double distanceFromOrigin()
double distanceFromPoint(Point2D<T> thePoint)
thePoint
-
T getX()
T getY()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |