|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.geom.Point2D
java.awt.geom.Point2D.Float
edu.uci.ics.jung.visualization.Coordinates
public class Coordinates
Stores coordinates (X,Y) for vertices being visualized.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.geom.Point2D |
---|
Point2D.Double, Point2D.Float |
Field Summary |
---|
Fields inherited from class java.awt.geom.Point2D.Float |
---|
x, y |
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 |
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.awt.geom.Point2D.Float |
---|
getX, getY, setLocation, setLocation, toString |
Methods inherited from class java.awt.geom.Point2D |
---|
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, hashCode, setLocation |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Coordinates()
public Coordinates(double x, double y)
public Coordinates(Coordinates coordinates)
coordinates
- Method Detail |
---|
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 |