|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.uci.ics.jung.visualization.Coordinates
Stores coordinates (X,Y) for vertices being visualized.
Constructor Summary | |
Coordinates()
|
|
Coordinates(Coordinates coordinates)
Initializes this coordinate to the value of the passed-in coordinate. |
|
Coordinates(double x,
double y)
|
Method Summary | |
void |
add(double x,
double y)
Increases the x and y values of this scalar by (x, y). |
void |
addX(double d)
Increases the x value by d. |
void |
addY(double d)
Increases the y value by d. |
double |
distance(Coordinates o)
Computes the euclidean distance between two coordinates |
double |
getX()
|
double |
getY()
|
Coordinates |
midpoint(Coordinates o)
Computes the midpoint between the two coordinates |
void |
mult(double x,
double y)
Multiplies a coordinate by scalar x and y values. |
void |
multX(double d)
Multiplies the X coordinate by a scalar value. |
void |
multY(double d)
Multiplies the Y coordinate by a scalar value. |
void |
setX(double d)
Sets the x value to be d; |
void |
setY(double d)
Sets the y value to be d; |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Coordinates()
public Coordinates(double x, double y)
public Coordinates(Coordinates coordinates)
coordinates
- Method Detail |
public double getX()
public double getY()
public void setX(double d)
d
- public void setY(double d)
d
- public void add(double x, double y)
x
- y
- public void addX(double d)
d
- public void addY(double d)
d
- public void mult(double x, double y)
x
- A scalar to multiple x byy
- A scalar to multiply y bypublic void multX(double d)
For example, (3, 10) x-scaled by 2 returns (6, 10).
d
- the scalar value by which x will be multipliedpublic void multY(double d)
For example, (3, 10) y-scaled by 2 returns (3, 20).
d
- the scalar value by which y will be multipliedpublic double distance(Coordinates o)
o
- another coordinates
public Coordinates midpoint(Coordinates o)
o
- another coordinates
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |