|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.base3d.worldview.object.Velocity
public class Velocity
Velocity within the world. Direction of the velocity is represented as a vector within the world's coordinates. Size of the velocity is represented by length of that vector.
Nested Class Summary | |
---|---|
static class |
Velocity.PropertyEditor
Property editor for Velocity. |
Field Summary | |
---|---|
double |
x
X coordinate. |
double |
y
Y coordinate. |
double |
z
Z coordinate. |
Constructor Summary | |
---|---|
Velocity()
Creates velocity with all values set to zeroes. |
|
Velocity(double[] d)
Creates velocity from array of three doubles. |
|
Velocity(double x,
double y)
Creates velocity with specified planar coordinates. |
|
Velocity(double x,
double y,
double z)
Creates velocity with specified coordinates. |
|
Velocity(Tuple3d v)
Creates velocity from specified 3D vector. |
|
Velocity(Velocity velocity)
Creates velocity same as the the passed one. |
Method Summary | |
---|---|
Velocity |
absolute()
Converts values of all three coordinates to absolute values. |
Velocity |
add(Velocity v)
Retreives sum of this velocity and given velocity. |
static Velocity |
add(Velocity v1,
Velocity v2)
Retreives sum of two given velocities. |
Velocity |
align()
Projects the velocity into the (x, y) plane, i.e. |
Location |
asLocation()
|
Vector3d |
asVector3d()
|
Velocity |
clone()
|
Velocity |
cross(Velocity v)
Computes cross product of this and other given velocity. |
static Velocity |
cross(Velocity v1,
Velocity v2)
Computes cross product of two given velocities. |
double |
dot(Velocity v)
Computes dot product of this and other given velocity. |
static double |
dot(Velocity v1,
Velocity v2)
Computes dot product of two given velocities. |
static boolean |
equal(Velocity v1,
Velocity v2)
Tells, whether two given velocities equal. |
static boolean |
equal(Velocity v1,
Velocity v2,
double epsilon)
Tells, whether the distance between coordinates of two given velocities is less than or equal to the given epsilon. |
boolean |
equals(Velocity v)
Tells, whether this velocity equals to given velocity. |
boolean |
equals(Velocity v,
double epsilon)
Tells, whether the distance between coordinates of this velocity and given velocity is less than or equal to the given epsilon. |
Vector3d |
getVector3d()
Retreives javax.vecmath.Vector3d representation of the velocity. |
Velocity |
getVelocity()
Retreives the velocity itself to implement ILocomotive . |
double |
getX()
X coordinate. |
double |
getY()
Y coordinate. |
double |
getZ()
Z coordinate. |
Velocity |
interpolate(Velocity v,
double d)
Linearly interpolates between this velocity and given velocity. |
static Velocity |
interpolate(Velocity v1,
Velocity v2,
double d)
Linearly interpolates between two given velocities. |
boolean |
isPlanarZero()
Tells, whether the velocity is zero in planar coordinates. |
boolean |
isZero()
Tells, whether the velocity is zero. |
boolean |
isZero(double epsilon)
Tells, whether the velocity is zero (with tolerance of 'epsilon'). |
Velocity |
negate()
Negates values of all three coordinates. |
Velocity |
normalize()
Retreives normalized vector of the velocity. |
Velocity |
scale(double d)
Scales values of all three coordinates by given multiplier. |
Velocity |
setX(double x)
Sets the X coordinate. |
Velocity |
setY(double y)
Sets the Y coordinate. |
Velocity |
setZ(double z)
Sets the Z coordinate. |
Velocity |
sideways()
Computes sideways velocity, i.e. |
double |
size()
Retreives size of the velocity. |
double |
sizeSquare()
Retreives squared size of the velocity. |
Velocity |
sub(Velocity v)
Retreives subtraction of given velocity from this velocity. |
static Velocity |
sub(Velocity v1,
Velocity v2)
Retreives subtraction of two given velocities. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public double x
public double y
public double z
Constructor Detail |
---|
public Velocity()
public Velocity(Velocity velocity)
velocity
- original velocity that will be copiedpublic Velocity(double x, double y, double z)
x
- X coordinate.y
- Y coordinate.z
- Z coordinate.public Velocity(double x, double y)
x
- X coordinate.y
- Y coordinate.public Velocity(double[] d)
d
- Array of (at least) three doubles to be used for creation.public Velocity(Tuple3d v)
v
- Vector in space to be used for creation.Method Detail |
---|
public Velocity clone()
clone
in class java.lang.Object
public Vector3d asVector3d()
public Location asLocation()
public double getX()
public double getY()
public double getZ()
public Velocity setX(double x)
public Velocity setY(double y)
public Velocity setZ(double z)
public boolean isZero()
public boolean isZero(double epsilon)
public boolean isPlanarZero()
public double size()
public double sizeSquare()
public Velocity normalize()
public Velocity negate()
public Velocity absolute()
public Velocity scale(double d)
d
- Scaling multiplier.
public double dot(Velocity v)
v
- Second velocity to be computed upon.
public static double dot(Velocity v1, Velocity v2)
v1
- First velocity to be computed upon.v2
- Second velocity to be computed upon.
public Velocity cross(Velocity v)
v
- Second velocity to be computed upon.
public static Velocity cross(Velocity v1, Velocity v2)
v1
- First velocity to be computed upon.v2
- Second velocity to be computed upon.
public Velocity add(Velocity v)
v
- Velocity to by added to this velocity.
public static Velocity add(Velocity v1, Velocity v2)
v1
- First velocity to by summed.v2
- Second velocity to by summed.
public Velocity sub(Velocity v)
v
- Velocity to be subtracted.
public static Velocity sub(Velocity v1, Velocity v2)
v1
- Velocity to be subtracted from.v2
- Velocity to be subtracted.
public Velocity interpolate(Velocity v, double d)
v
- Velocity to be interpolated to.d
- Interpolation parameter.
public static Velocity interpolate(Velocity v1, Velocity v2, double d)
v1
- Velocity to be interpolated from.v2
- Velocity to be interpolated to.d
- Interpolation parameter.
public boolean equals(Velocity v)
v
- Velocity to be compared with.
public static boolean equal(Velocity v1, Velocity v2)
v1
- First velocity to comapre.v2
- Second velocity to comapre.
public boolean equals(Velocity v, double epsilon)
v
- Velocity to comapre with.epsilon
- Epsilon to compare with.
public static boolean equal(Velocity v1, Velocity v2, double epsilon)
v1
- First velocity to comapre.v2
- Second velocity to comapre.epsilon
- Epsilon to compare with.
public Velocity align()
public Velocity sideways()
Note: Ignores the z coordinate whatsoever, which is the same as projecting the velocity to the (x, y) plane. Calculates orthogonal vector to this projection. Returns vector (y, -x, 0).
public Velocity getVelocity()
ILocomotive
.
getVelocity
in interface ILocomotive
public Vector3d getVector3d()
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 |