|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.aerith.misao.util.Position
The Position
represents a position which consists of
(x,y) position. The position is expressed in float data.
Field Summary | |
protected float |
x
The x value. |
protected float |
y
The y value. |
Constructor Summary | |
Position()
Constructs an empty Position . |
|
Position(double initial_x,
double initial_y)
Constructs a Position with specified position. |
|
Position(Position source_position)
Constructs a Position by copy. |
Method Summary | |
void |
add(Position position)
Adds the specified Position to this. |
double |
getDistanceFrom(Position position)
Gets the distance from the specified position. |
double |
getPositionAngleTo(Position position)
Gets the position angle from this position to the specified position. |
double |
getX()
Gets the x value. |
double |
getY()
Gets the y value. |
protected java.lang.String |
paramString()
Returns a raw string representation of the state of this object, for debugging use. |
void |
rescale(double ratio)
Rescales the position by magnifying the specified value. |
void |
setPosition(Position new_position)
Sets the position. |
void |
setX(double new_x)
Sets the x value. |
void |
setY(double new_y)
Sets the y value. |
java.lang.String |
toString()
Returns a string representation of the state of this object, for debugging use. |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected float x
protected float y
Constructor Detail |
public Position()
Position
. The position is set
at (0,0).public Position(double initial_x, double initial_y)
Position
with specified position.initial_x
- the x position.initial_y
- the y position.public Position(Position source_position)
Position
by copy.source_position
- the source position to copy.Method Detail |
public double getX()
public void setX(double new_x)
new_x
- the new x value.public double getY()
public void setY(double new_y)
new_y
- the new y value.public void setPosition(Position new_position)
new_position
- the new position.public void add(Position position)
Position
to this.position
- the value to add.public void rescale(double ratio)
ratio
- the value to magnify.public double getDistanceFrom(Position position)
position
- the position.public double getPositionAngleTo(Position position)
position
- the position.protected java.lang.String paramString()
toString
method of the subclasses.public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |