|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaspack.matrix.VectorObject
maspack.spatialmotion.SpatialVector
A spatial vector, which is a 6-vector composed of two 3-vectors: a free vector and a line vector. Spatial vectors are described in Featherstone, Robot Dynamics Algorithms, and are used to represent quantities such as spatial velocities (or twists), spatial forces (or wrenchs).
Spatial vectors are either contarvariant (those associated with motion), or covariant (those associated with forces). For a contravariant spatial vector, elements 0-2 correspond to the free vector and elements 3-5 correspond to the line vector. For a covarient spatial vector, elements 0-2 correspond to the line vector and elements 3-5 correspond to the free vector (note that this transposing of element ordering is different from the treatment in Featherstone, which always asigns elements 0-2 to the line vector).
Method Summary | |
void |
absolute()
Sets the elements of this spatial vector to their absolute values. |
double |
dot(SpatialVector v1)
Returns the dot product of this spatial vector and the spatial vector v1. |
boolean |
epsilonEquals(SpatialVector v1,
double eps)
Returns true if the elements of this spatial vector equal those of vector v1 within a
prescribed tolerance epsilon . |
boolean |
equals(SpatialVector v1)
Returns true if the elements of this spatial vector exactly equal those of vector v1 . |
void |
get(double[] values)
Copies the elements of this spatial vector into an array of doubles. |
double |
get(int i)
Gets a single element of this spatial vector. |
double |
infinityNorm()
Returns the infinity norm of this spatial vector. |
void |
inverseTransform(RigidTransform3d X)
Applies an inverse rigid spatial transformation to this vector, in place. |
void |
inverseTransform(RotationMatrix3d R)
Applies an inverse rotational transformation to this spatial vector, in place. |
boolean |
isContravariant()
Returns true if this spatial vector is contravariant. |
double |
maxElement()
Returns the maximum element value of this spatial vector. |
double |
minElement()
Returns the minimum element value of this spatial vector. |
void |
negate()
Negates this spatial vector in place. |
double |
norm()
Returns the 2 norm of this spatial vector. |
void |
normalize()
Normalizes this spatial vector in place. |
double |
normSquared()
Returns the square of the 2 norm of this spatial vector. |
double |
oneNorm()
Returns the 1 norm of this spatial vector. |
void |
scale(double s)
Scales the elements of this spatial vector by s . |
void |
set(double[] values)
Sets the elements of this spatial vector from an array of doubles. |
void |
set(int i,
double value)
Sets a single element of this spatial vector. |
void |
setRandom()
Sets the elements of this vector to uniformly distributed random values in the range -0.5 (inclusive) to 0.5 (exclusive). |
void |
setRandom(double lower,
double upper)
Sets the elements of this vector to uniformly distributed random values in a specified range. |
void |
setRandom(double lower,
double upper,
java.util.Random generator)
Sets the elements of this vector to uniformly distributed random values in a specified range, using a supplied random number generator. |
void |
setZero()
Sets the elements of this spatial vector to zero. |
int |
size()
Returns the size of this spatial vector (which is always 6) |
java.lang.String |
toString(NumberFormat fmt)
Returns a String representation of this vector, in which each element is formated using a C printf style as decribed
by the parameter NumberFormat . When called numerous
times, this routine can be more efficient than toString(String) , because the NumberFormat does not need to be recreated each time
from a specification string. |
void |
transform(RigidTransform3d X)
Applies a rigid spatial transformation to this spatial vector, in place. |
void |
transform(RotationMatrix3d R)
Applies a rotational transformation to this spatial vector, in place. |
Methods inherited from class maspack.matrix.VectorObject |
dot, epsilonEquals, equals, equals, get, isFixedSize, scan, set, setSize, toString, toString |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public int size()
size
in class VectorObject
public boolean isContravariant()
public double get(int i)
get
in class VectorObject
i
- element index
public void get(double[] values)
get
in class VectorObject
values
- array into which values are copiedpublic void set(int i, double value)
set
in class VectorObject
i
- element indexvalue
- element value
public void set(double[] values)
set
in class VectorObject
values
- array from which values are copiedpublic void negate()
public void scale(double s)
s
.
s
- scaling factorpublic double norm()
norm
in class VectorObject
public double normSquared()
normSquared
in class VectorObject
public double maxElement()
maxElement
in class VectorObject
public double minElement()
minElement
in class VectorObject
public double infinityNorm()
infinityNorm
in class VectorObject
public double oneNorm()
oneNorm
in class VectorObject
public double dot(SpatialVector v1)
public void normalize()
public boolean epsilonEquals(SpatialVector v1, double eps)
v1
within a
prescribed tolerance epsilon
.
v1
- vector to compare witheps
- comparison tolerance
public boolean equals(SpatialVector v1)
v1
.
v1
- vector to compare with
public void setZero()
public void absolute()
public void transform(RotationMatrix3d R)
R
- rotational transformation matrixpublic void inverseTransform(RotationMatrix3d R)
R
- rotational transformation matrixpublic void transform(RigidTransform3d X)
X
- rigid spatial transformationpublic void inverseTransform(RigidTransform3d X)
X
- rigid spatial transformationpublic java.lang.String toString(NumberFormat fmt)
printf
style as decribed
by the parameter NumberFormat
. When called numerous
times, this routine can be more efficient than toString(String)
, because the NumberFormat
does not need to be recreated each time
from a specification string.
toString
in class VectorObject
fmt
- numeric format
public void setRandom()
public void setRandom(double lower, double upper)
lower
- lower random value (inclusive)upper
- upper random value (exclusive)public void setRandom(double lower, double upper, java.util.Random generator)
lower
- lower random value (inclusive)upper
- upper random value (exclusive)generator
- random number generator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |