|
|||||||||
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.SpaceVec
public final class SpaceVec
Immutable class to represent a space vector.
Nested Class Summary | |
---|---|
static class |
SpaceVec.Distance
Distance function, which imposes a total ordering of space vectors by comparing the distance to a center. |
static class |
SpaceVec.IndexComparator
Comparison function, which imposes a total ordering of space vectors by selecting one of the components of the space vector. |
Field Summary | |
---|---|
static SpaceVec |
ORIGIN
The origin of three dimensional space. |
Fields inherited from interface jasi.sim.geo.Geometric |
---|
BEGIN, END, MIDLE |
Constructor Summary | |
---|---|
SpaceVec(Space x,
Space y)
Constructor of a space vector, with vanishing third component. |
|
SpaceVec(Space x,
Space y,
Space z)
Constructor of a space vector. |
|
SpaceVec(SpaceVec s)
Constructor of a space vector. |
|
SpaceVec(java.lang.String s)
Constructor of a space vector. |
Method Summary | |
---|---|
Space |
abs()
Retrieve this space vector's absolute value, i.e. its distance from the origin of space. |
SpaceVec |
add(SpaceVec p)
Add that space vector to this space vector. |
Space[] |
components()
Get the components of this space vector. |
Direction |
direction()
Retrieve this space vector's unit direction to origin of space. |
Space |
distance(SpaceVec p)
Retrieve the distance of this space vector from that space vector. |
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 |
minus(SpaceVec p)
Subtract that space vector from this space vector. |
SpaceVec |
times(double f)
Multiply this space vector by a factor. |
java.lang.String |
toString()
Returns a string representation of this 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 SpaceVec ORIGIN
Constructor Detail |
---|
public SpaceVec(Space x, Space y, Space z)
x
- First component.y
- Second component.z
- Third component.public SpaceVec(SpaceVec s)
s
- A space vector.public SpaceVec(Space x, Space y)
x
- First component.y
- Second component.public SpaceVec(java.lang.String s)
s
- The string representation of a space vector object.Method Detail |
---|
public Space distance(SpaceVec p)
p
- That point.
public Space abs()
public Direction direction()
public SpaceVec add(SpaceVec p)
p
- That space vector.
public SpaceVec minus(SpaceVec p)
p
- That space vector.
public SpaceVec times(double f)
f
- The multiplication factor.
public Space[] components()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- 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 |