|
Draw2D v2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.eclipse.draw2d.geometry.Ray
Provides support for vector type calculations.
| Field Summary | |
int |
x
|
int |
y
|
| Constructor Summary | |
Ray()
Constructs a Ray of no direction and magnitude. |
|
Ray(int _x,
int _y)
Constructs a Ray with direction from the origin(0,0) to the coordinates given. |
|
Ray(Point p)
Constructs a Ray with direction from the origin(0,0) to the Point given. |
|
Ray(Point start,
Point end)
Constructs a Ray which points from the first input Point to the second input Point. |
|
Ray(Ray start,
Ray end)
Constructs a Ray which connects both the Rays given as input. |
|
| Method Summary | |
int |
assimilarity(Ray r)
Returns the cross product of this Ray and r. |
int |
dotProduct(Ray p)
Returns the dot product of this Ray and p. |
Ray |
getAdded(Ray r)
Returns a new Ray which is the sum of this Ray and the input Ray r. |
Ray |
getAveraged(Ray r)
Returns a new Ray which points, along all axes, to the middle region of this Ray and the input Ray r. |
Ray |
getScaled(int s)
Returns a new Ray which has this Ray's magnitude scaled by the value provided as input. |
boolean |
isHorizontal()
Returns whether this Ray points horizontally or not. |
double |
length()
Returns the length of this Ray. |
int |
similarity(Ray r)
Returns the similarity of direction between this Ray and the Ray given. |
String |
toString()
Returns the String description of this Ray. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public int x
public int y
| Constructor Detail |
public Ray()
public Ray(int _x,
int _y)
_x - Location along X Axis._y - Location along Y axis.public Ray(Point p)
p - Point to which the ray will point from
the origin.
public Ray(Point start,
Point end)
start - Strarting point of the ray.end - Ending point of the ray.
public Ray(Ray start,
Ray end)
start - Direction of the start of this Ray.end - Direction of the end of this Ray.| Method Detail |
public int assimilarity(Ray r)
r - Ray being compared.similarity(Ray)public int dotProduct(Ray p)
public Ray getAdded(Ray r)
r - Ray to be added to this Ray.public Ray getAveraged(Ray r)
r - Ray to calculate the average.public Ray getScaled(int s)
s - Value providing the amount to scale.public boolean isHorizontal()
public double length()
public int similarity(Ray r)
r - Ray being tested for similarity.assimilarity(Ray)public String toString()
toString in class Object
|
Draw2D v2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||