|
Eclipse Draw2d 3.3 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.eclipse.draw2d.geometry.Ray
Represents a 2-dimensional directional Vector, or Ray. Vector is
commonly imported, so the name Ray was chosen.
| Field Summary | |
int |
x
the X value |
int |
y
the Y value |
| Constructor Summary | |
Ray()
Constructs a Ray <0, 0> with no direction and magnitude. |
|
Ray(int x,
int y)
Constructs a Ray pointed in the specified direction. |
|
Ray(Point p)
Constructs a Ray pointed in the direction specified by a Point. |
|
Ray(Point start,
Point end)
Constructs a Ray representing the direction and magnitude between to provided Points. |
|
Ray(Ray start,
Ray end)
Constructs a Ray representing the difference between two provided Rays. |
|
| Method Summary | |
int |
assimilarity(Ray r)
Calculates the magnitude of the cross product of this Ray with another. |
int |
dotProduct(Ray r)
Calculates the dot product of this Ray with another. |
boolean |
equals(Object obj)
|
Ray |
getAdded(Ray r)
Creates a new Ray which is the sum of this Ray with another. |
Ray |
getAveraged(Ray r)
Creates a new Ray which represents the average of this Ray with another. |
Ray |
getScaled(int s)
Creates a new Ray which represents this Ray scaled by the amount provided. |
int |
hashCode()
|
boolean |
isHorizontal()
Returns true if this Ray has a non-zero horizontal comonent. |
double |
length()
Returns the length of this Ray. |
int |
similarity(Ray r)
Calculates the similarity of this Ray with another. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public int x
public int y
| Constructor Detail |
public Ray()
public Ray(int x,
int y)
x - X value.y - Y value.public Ray(Point p)
p - the Point
public Ray(Point start,
Point end)
start - Strarting Pointend - End Point
public Ray(Ray start,
Ray end)
start - The start Rayend - The end Ray| Method Detail |
public int assimilarity(Ray r)
r - Ray being compared
similarity(Ray)public int dotProduct(Ray r)
r - the Ray used to perform the dot product
public boolean equals(Object obj)
Object.equals(Object)public Ray getAdded(Ray r)
r - Ray to be added with 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 int hashCode()
Object.hashCode()public boolean isHorizontal()
public double length()
public int similarity(Ray r)
r - Ray being tested for similarity
assimilarity(Ray)public String toString()
|
Eclipse Draw2d 3.3 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||