|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectRay
public class Ray
Represents an immutable ray with a starting point and a direction. The direction would normally, but not necessarily, have a length of one.
| Method Summary | |
|---|---|
static Ray |
create(double x,
double y,
double dx,
double dy)
Returns a ray with the given starting point and direction. |
double |
dot(Ray o)
Returns the result of the dot product of this ray's direction with the parameter ray's direction. |
double |
getDeltaX()
Returns the change in x for one unit along this ray's direction. |
double |
getDeltaY()
Returns the change in y for one unit along this ray's direction. |
Ray |
getReverse()
Returns a ray in the reverse direction of this one. |
double |
getX()
Returns the x-coordinate of this ray's starting point. |
double |
getY()
Returns the y-coordinate of this ray's starting point. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public double getX()
public double getY()
public double getDeltaX()
public double getDeltaY()
public double dot(Ray o)
public Ray getReverse()
public java.lang.String toString()
toString in class java.lang.Object
public static Ray create(double x,
double y,
double dx,
double dy)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||