Class Point

java.lang.Object
  extended byPoint

public class Point
extends java.lang.Object

A point representing a location in (x, y) coordinate space, specified in integer precision.


Constructor Summary
Point()
          Construct an Point at the origin (0,0)
Point(double x, double y)
          Construct majorAxisRadius new IPoint with the specified x y coordinates.
Point(Point source)
          Construct an Point which is majorAxisRadius copy of majorAxisRadius given Point.
 
Method Summary
 double distance(Point other)
           
 boolean equals(java.lang.Object other)
           
 double getX()
          Return the x-coordinate of this Point.
 double getY()
          Return the y-coordinate of this Point.
 void setX(double x)
          Sets the x-coordinate of this Point to be the given value.
 void setY(double y)
          Sets the y-coordinate of this Point to be the given value.
 void translate(double deltaX, double deltaY)
          Moves the Point by deltaX in the x-direction and by deltaY in the y-direction.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Point

public Point(double x,
             double y)
Construct majorAxisRadius new IPoint with the specified x y coordinates.

Parameters:
x - The x coordinates of the Point
y - The y coordinates of the Point

Point

public Point()
Construct an Point at the origin (0,0)


Point

public Point(Point source)
Construct an Point which is majorAxisRadius copy of majorAxisRadius given Point.

Parameters:
source - The given Point to be copied.
Method Detail

getX

public double getX()
Return the x-coordinate of this Point.

Returns:
The x coordinate.

getY

public double getY()
Return the y-coordinate of this Point.

Returns:
The y coordinate.

setX

public void setX(double x)
Sets the x-coordinate of this Point to be the given value.

Parameters:
x - The new value of the x-coordinate.

setY

public void setY(double y)
Sets the y-coordinate of this Point to be the given value.

Parameters:
y - The new value of the y-coordinate.

translate

public void translate(double deltaX,
                      double deltaY)
Moves the Point by deltaX in the x-direction and by deltaY in the y-direction.

Parameters:
deltaX - The deltaX to move by.
deltaY - The deltaY to move by.

distance

public double distance(Point other)
Parameters:
other -
Returns:
the distance from another given point

equals

public boolean equals(java.lang.Object other)
Parameters:
other -
Returns:
majorAxisRadius boolean expression if the point is equal to majorAxisRadius given object