|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmhframework.MHPoint
public class MHPoint
Represents a point in 2D space. This class also contains functions for translating this point along a vector and rotating it around another point.
Constructor Summary | |
---|---|
MHPoint()
Default constructor. |
|
MHPoint(double xValue,
double yValue)
Constructor. |
|
MHPoint(MHPoint point)
Constructor. |
Method Summary | |
---|---|
MHPoint |
clone()
Creates an exact copy of this point. |
double |
getX()
Returns the x component of this point. |
double |
getY()
Returns the y component of this point. |
void |
rotate(double originX,
double originY,
double angle)
Rotates this point around (originX, originY) by the angle specified. |
void |
setLocation(double x,
double y)
Sets the location of this point. |
void |
setX(double x)
Sets the x component of this point. |
void |
setY(double y)
Sets the y component of this point. |
void |
translate(double angle,
double distance)
Translates this point in the direction specified by angle to the distance specified by distance. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MHPoint()
public MHPoint(double xValue, double yValue)
public MHPoint(MHPoint point)
Method Detail |
---|
public double getX()
public void setX(double x)
public double getY()
public void setY(double y)
public void setLocation(double x, double y)
public void rotate(double originX, double originY, double angle)
originX
- The x component of the point around which to
rotate this point.originY
- The y component of the point around which to
rotate this point.angle
- The angle by which to rotate this point.public void translate(double angle, double distance)
angle
- The angle at which this point is to be translated.distance
- The distance that this point is to be translated.public MHPoint clone()
clone
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |