|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjasi.sim.geo.GeoObject
jasi.sim.geo.cartesian.Direction
public final class Direction
Immutable class to represent a unit direction.
| Field Summary | |
|---|---|
static Direction |
X
X-direction. |
static Direction |
Y
Y-direction. |
static Direction |
Z
Z-direction. |
| Fields inherited from interface jasi.sim.geo.Geometric |
|---|
BEGIN, END, MIDLE |
| Constructor Summary | |
|---|---|
Direction(Direction d)
Constructor of a unit direction. |
|
Direction(double x,
double y)
Constructor of a unit direction, with vanishing third component. |
|
Direction(double x,
double y,
double z)
Constructor of a unit direction. |
|
Direction(java.lang.String s)
Constructor of a unit direction. |
|
| Method Summary | |
|---|---|
double[] |
components()
Get the components of this direction. |
Direction |
cross(Direction d)
Calculate the cross product between this and that direction, i.e., the sine of the angle. |
double |
dot(Direction d)
Calculate the scalar product between this and that direction, i.e., the cosine of the angle. |
boolean |
equals(java.lang.Object o)
Indicates whether some other object is "equal to" this one. |
int |
hashCode()
Returns a hash code value for the object. |
SpaceVec |
times(Space d)
Get a space vector from this direction by providing a distance, i.e. a space value. |
SpeedVec |
times(Speed s)
Get a speed vector from this direction by providing a speed value. |
java.lang.String |
toString()
Returns a string representation of this space object. |
| Methods inherited from class jasi.sim.geo.GeoObject |
|---|
getContent |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Direction X
public static final Direction Y
public static final Direction Z
| Constructor Detail |
|---|
public Direction(double x,
double y,
double z)
x - First component.y - Second component.z - Third component.public Direction(Direction d)
d - A direction.
public Direction(double x,
double y)
x - First component.y - Second component.public Direction(java.lang.String s)
s - The string representation of a direction.| Method Detail |
|---|
public double dot(Direction d)
d - That direction.
public Direction cross(Direction d)
d - That direction.
public SpaceVec times(Space d)
d - The space value.
public SpeedVec times(Speed s)
s - The speed value.
public double[] components()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - That object which is compared with this object.
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||