Q
- The Quantity (unit type) of the elements of this vector.public final class VectorTrans<Q extends Quantity> extends GeomVector<Q> implements GeomTransform<GeomVector>
GeomTransform
element that refers to a GeomVector
object and
masquerades as a GeomVector object itself.
Modified by: Joseph A. Huwaldt
X, Y, Z
RESOURCES
Modifier and Type | Method and Description |
---|---|
VectorTrans<Q> |
copy()
Returns a copy of this VectorTrans instance
allocated by the calling thread
(possibly on the stack). |
Vector<Q> |
copyToReal()
Return a copy of the child object transformed by this transformation.
|
Vector<? extends Quantity> |
cross(GeomVector<?> that)
Returns the cross product of two vectors.
|
Vector<Q> |
divide(double divisor)
Returns this vector with each element divided by the specified divisor
(dimensionless).
|
Vector<? extends Quantity> |
divide(Parameter<?> that)
Returns this vector with each element divided by the specified divisor.
|
boolean |
equals(java.lang.Object obj)
Compares this VectorTrans against the specified object for strict equality (same
values and same units).
|
GeomVector<Q> |
getChild()
Returns the child object transformed by this transform element.
|
Point |
getOrigin()
Return the origin point for this vector.
|
int |
getPhyDimension()
Returns the number of physical dimensions of the geometry element.
|
GTransform |
getTotalTransform()
Returns the total transformation represented by an entire chain of GeomTransform
objects below this one.
|
GTransform |
getTransform()
Returns the transformation represented by this transformation element.
|
VectorTrans<Q> |
getTransformed(GTransform transform)
Returns transformed version of this element.
|
Unit |
getUnit()
Returns the unit in which the
values in this vector are stated
in. |
double |
getValue(int i)
Returns the value of the Parameter in this vector as a
double , stated
in this vector's unit . |
double |
getValue(int i,
Unit<Q> unit)
Returns the value of the Parameter in this vector as a
double , stated
in the specified units. |
int |
hashCode()
Returns the hash code for this parameter.
|
Vector<Q> |
immutable()
Return an immutable version of this vector.
|
Vector<Q> |
minus(GeomVector<Q> that)
Returns the difference between this vector and the one specified.
|
Vector<Q> |
minus(Parameter<Q> that)
Subtracts the supplied Parameter from each element of this vector and returns the
result.
|
static <Q extends Quantity> |
newInstance(GeomVector<Q> child,
GTransform transform)
|
double |
normValue()
Returns the
GeomVector.norm() , magnitude, or length value of the vector from the origin
to this point (square root of the dot product of the origin-to-this-point vector
and itself). |
Vector<Q> |
opposite()
Returns the negation of this vector.
|
Vector<Q> |
plus(GeomVector<Q> that)
Returns the sum of this vector with the one specified.
|
Vector<Q> |
plus(Parameter<Q> that)
Returns the sum of this vector with the parameter specified.
|
static void |
recycle(VectorTrans instance)
Recycles a
VectorTrans instance immediately (on the stack when
executing in a StackContext ). |
void |
setOrigin(Point origin)
Set the origin point for this vector.
|
void |
setTransform(GTransform transform)
Sets the transformation represented by this transformation element.
|
Vector<Q> |
times(double k)
Returns the product of this vector with the specified coefficient (dimensionless).
|
Parameter<? extends Quantity> |
times(GeomVector<?> that)
Returns the dot product (scalar product) of this vector with the one specified.
|
Vector<? extends Quantity> |
times(Parameter<?> k)
Returns the product of this vector with the specified coefficient.
|
Vector<? extends Quantity> |
timesEBE(GeomVector<?> that)
Returns the element-by-element product of this vector with the one specified.
|
GeomVector |
to(Unit unit)
Returns the equivalent to this vector but stated in the specified unit.
|
VectorTrans<Q> |
toDimension(int newDim)
Return the equivalent of this vector converted to the specified number of physical
dimensions.
|
Float64Vector |
toFloat64Vector()
Returns a
Float64Vector containing the elements of this vector stated
in the current units. |
ParameterVector<Q> |
toParameterVector()
Returns a
ParameterVector representation of this vector. |
Vector<Dimensionless> |
toUnitVector()
Returns this vector converted to a unit vector by dividing all the vector's
elements by the length (
GeomVector.norm() ) of this vector. |
angle, dot, get, getBoundsMax, getBoundsMin, getLimitPoint, getParDimension, isApproxEqual, isApproxEqual, isValid, mag, magValue, norm, size, toArray, toArray, toText
addChangeListener, clone, compareTo, getAllUserData, getID, getName, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, reset, setName, toString
addChangeListener, getAllUserData, getBoundsMax, getBoundsMin, getID, getLimitPoint, getName, getParDimension, getUserData, isValid, putAllUserData, putUserData, removeChangeListener, removeUserData, setName, size, toText
public static <Q extends Quantity> VectorTrans<Q> newInstance(GeomVector<Q> child, GTransform transform)
Q
- The Quantity (unit type) of this vector.child
- The vector that is the child of this transform element (may not be
null
).transform
- The transform held by this transform element (may not be
null
).DimensionException
- if the input element is not 3D.public GTransform getTransform()
getTransform
in interface GeomTransform<GeomVector>
public GTransform getTotalTransform()
getTotalTransform
in interface GeomTransform<GeomVector>
public void setTransform(GTransform transform)
setTransform
in interface GeomTransform<GeomVector>
transform
- The transform to set this transform element to (may not be
null
).public GeomVector<Q> getChild()
getChild
in interface GeomTransform<GeomVector>
public Vector<Q> copyToReal()
copyToReal
in interface GeomElement<GeomVector>
copyToReal
in interface GeomTransform<GeomVector>
public static void recycle(VectorTrans instance)
VectorTrans
instance immediately (on the stack when
executing in a StackContext
).instance
- The instance to be recycled.public int getPhyDimension()
getPhyDimension
in interface GeomElement<GeomVector>
public double getValue(int i)
double
, stated
in this vector's unit
.getValue
in class GeomVector<Q extends Quantity>
i
- the dimension index.i
.java.lang.IndexOutOfBoundsException
- (i < 0) || (i ≥ getPhyDimension())
public double getValue(int i, Unit<Q> unit)
double
, stated
in the specified units.getValue
in class GeomVector<Q extends Quantity>
i
- the dimension index.unit
- the unit to return the value in. May not be null.i
in the specified unit.java.lang.IndexOutOfBoundsException
- (i < 0) || (i ≥ getPhyDimension())
public void setOrigin(Point origin)
setOrigin
in class GeomVector<Q extends Quantity>
origin
- The new origin point for the vector. May not be null.public Point getOrigin()
getOrigin
in class GeomVector<Q extends Quantity>
public double normValue()
GeomVector.norm()
, magnitude, or length value of the vector from the origin
to this point (square root of the dot product of the origin-to-this-point vector
and itself).normValue
in class GeomVector<Q extends Quantity>
this.norm().doubleValue()
.public Vector<Q> opposite()
opposite
in class GeomVector<Q extends Quantity>
-this
.public Vector<Q> plus(GeomVector<Q> that)
plus
in class GeomVector<Q extends Quantity>
that
- the vector to be added. May not be null.this + that
.DimensionException
- if vector dimensions are different.public Vector<Q> plus(Parameter<Q> that)
plus
in class GeomVector<Q extends Quantity>
that
- the parameter to be added to each element of this vector. May not be null.this + that
.public Vector<Q> minus(GeomVector<Q> that)
minus
in class GeomVector<Q extends Quantity>
that
- the vector to be subtracted from this vector. May not be null.this - that
.DimensionException
- if vector dimensions are different.public Vector<Q> minus(Parameter<Q> that)
minus
in class GeomVector<Q extends Quantity>
that
- the Parameter to be subtracted from each element of this vector. May
not be null.this - that
.public Vector<Q> times(double k)
times
in class GeomVector<Q extends Quantity>
k
- the coefficient multiplier.this · k
public Vector<? extends Quantity> times(Parameter<?> k)
times
in class GeomVector<Q extends Quantity>
k
- the coefficient multiplier. May not be null.this · k
public Parameter<? extends Quantity> times(GeomVector<?> that)
times
in class GeomVector<Q extends Quantity>
that
- the vector multiplier. May not be null.this · that
DimensionException
- if this.dimension() != that.dimension()
public Vector<? extends Quantity> timesEBE(GeomVector<?> that)
timesEBE
in class GeomVector<Q extends Quantity>
that
- the vector multiplier. May not be null.this .* that
DimensionException
- if this.dimension() != that.dimension()
public Vector<? extends Quantity> cross(GeomVector<?> that)
cross
in class GeomVector<Q extends Quantity>
that
- the vector multiplier. May not be null.this x that
DimensionException
- if
(that.getDimension() != this.getDimension())
public Vector<Q> divide(double divisor)
divide
in class GeomVector<Q extends Quantity>
divisor
- the divisor.this / divisor
.public Vector<? extends Quantity> divide(Parameter<?> that)
divide
in class GeomVector<Q extends Quantity>
that
- the divisor. May not be null.this / that
.public Vector<Q> immutable()
immutable
in class GeomVector<Q extends Quantity>
public Vector<Dimensionless> toUnitVector()
GeomVector.norm()
) of this vector.toUnitVector
in class GeomVector<Q extends Quantity>
public Unit getUnit()
values
in this vector are stated
in.getUnit
in interface GeomElement<GeomVector>
public GeomVector to(Unit unit) throws ConversionException
to
in interface GeomElement<GeomVector>
unit
- the unit of the vector to be returned. May not be null.ConversionException
- if the the input unit is not compatible with this unit.public ParameterVector<Q> toParameterVector()
ParameterVector
representation of this vector.toParameterVector
in class GeomVector<Q extends Quantity>
public Float64Vector toFloat64Vector()
Float64Vector
containing the elements of this vector stated
in the current units.toFloat64Vector
in class GeomVector<Q extends Quantity>
public VectorTrans<Q> getTransformed(GTransform transform)
GeomTransform
and contains this element as a child.getTransformed
in interface Transformable<GeomVector>
getTransformed
in class GeomVector<Q extends Quantity>
transform
- The transform to apply to this vector. May not be null.public VectorTrans<Q> toDimension(int newDim)
toDimension
in interface GeomElement<GeomVector>
toDimension
in class GeomVector<Q extends Quantity>
newDim
- The dimension of the vector to return. MUST equal 3.java.lang.IllegalArgumentException
- if the new dimension is anything other than 3.public boolean equals(java.lang.Object obj)
equals
in class AbstractGeomElement<GeomVector>
obj
- the object to compare with.true
if this point is identical to that point;
false
otherwise.public int hashCode()
hashCode
in class AbstractGeomElement<GeomVector>
public VectorTrans<Q> copy()
allocated
by the calling thread
(possibly on the stack).copy
in interface GeomElement<GeomVector>
copy
in class GeomVector<Q extends Quantity>