edu.columbia.cs.coms4701.geometry
Interface Point2D<T extends java.lang.Number>

All Known Implementing Classes:
DiscretePoint2D

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.

Version:
0.1

User: aaron Date: Aug 25, 2006 Time: 10:27:13 AM

Author:
aaron@cs

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

translateBy

Point2D<T> translateBy(GeometricVector<T> theVector)
Returns a new point at the coordinate translated from this point's position by the given vector

Parameters:
theVector -

distanceFromOrigin

double distanceFromOrigin()
Returns the distance of this point from the origin.

Returns:
distance from origin (0,0)

distanceFromPoint

double distanceFromPoint(Point2D<T> thePoint)
Returns the distance between this point and the given point.

Parameters:
thePoint -
Returns:
distance between the two points

getX

T getX()
Returns x coordinate

Returns:
x coordinate

getY

T getY()
Returns y coordinate

Returns:
y coordinate