@CodeReview(reviewer="Justin Basilico", date="2006-07-26", changesNeeded=false, comments="Looks good.") public class Vector3 extends DenseVector implements Vector3D
DenseVector.Vector.IndexValueConsumer, Vector.IndexValueTransformVectorSpace.EntryDEFAULT_DELIMITER| Constructor and Description |
|---|
Vector3()
Creates a new instance of Vector3 that is all zeros.
|
Vector3(double x,
double y,
double z)
Creates a new instance of Vector3 with the given values.
|
Vector3(Vector other)
Creates a new instance of Vector3 with values copied from the given
vector.
|
Vector3(Vector3D other)
Creates a new instance of Vector3 with values copied from the given
vector.
|
| Modifier and Type | Method and Description |
|---|---|
Vector3 |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
static Vector3 |
createRandom(java.util.Random random)
Creates a new random Vector3 from the given Random object.
|
int |
getDimensionality()
Returns the number of elements in the Vector
|
java.lang.Double |
getFirst()
Gets the first object.
|
java.lang.Double |
getSecond()
Gets the second object.
|
java.lang.Double |
getThird()
Gets the third object.
|
double |
getX()
Gets the value of the first dimension (x).
|
double |
getY()
Gets the value of the second dimension (y).
|
double |
getZ()
Gets the value of the third dimension (z).
|
void |
setX(double x)
Sets the value of the first dimension (x).
|
void |
setXYZ(double x,
double y,
double z)
Sets the value of all three dimensions of this vector.
|
void |
setY(double y)
Sets the value of the second dimension (y).
|
void |
setZ(double z)
Sets the value of the third dimension (z).
|
java.lang.String |
toString()
The String representation of the Vector3, which is "<x, y, z>".
|
countNonZeros, equals, euclideanDistanceSquared, forEachElement, forEachEntry, forEachNonZero, get, getArray, getElement, getEntryCount, getMaxValue, getMinValue, getVectorFactory, isSparse, outerProduct, set, setElement, setInternalVector, setInternalVector, stack, subVector, sum, transformEquals, transformEquals, transformNonZerosEquals, transformNonZerosEqualsdotProduct, dotProduct, dotTimesEquals, getInternalVector, increment, iterator, minusEquals, minusEquals, norm2, norm2Squared, outerProduct, plusEquals, plusEquals, scaledMinusEquals, scaledPlusEquals, scaledPlusEquals, scaleEquals, times, times, zeroassertDimensionalityEquals, assertEqualDimensionality, assertSameDimensionality, checkSameDimensionality, convertFromVector, convertToVector, decrement, decrement, dotDivide, dotDivideEquals, equals, hashCode, increment, toArray, toString, toString, transform, transform, transformNonZeros, transformNonZeros, valuesAsListangle, cosine, dot, euclideanDistance, isUnitVector, isUnitVector, isZero, norm, norm1, normInfinity, unitVector, unitVectorEqualsdotTimes, isZero, minus, negative, negativeEquals, plus, scale, scaledMinus, scaledMinusEquals, scaledPlusfinalize, getClass, notify, notifyAll, wait, wait, waitassertDimensionalityEquals, assertSameDimensionality, checkSameDimensionality, countNonZeros, decrement, decrement, dotDivide, dotDivideEquals, forEachElement, forEachEntry, forEachNonZero, get, getElement, getEntryCount, getVectorFactory, increment, increment, isSparse, outerProduct, set, setElement, stack, subVector, times, toArray, toString, toString, transform, transform, transformEquals, transformEquals, transformNonZeros, transformNonZeros, transformNonZerosEquals, transformNonZerosEquals, valuesAsListangle, cosine, dot, dotProduct, euclideanDistance, euclideanDistanceSquared, getMaxValue, getMinValue, isUnitVector, isUnitVector, norm, norm1, norm2, norm2Squared, normInfinity, sum, unitVector, unitVectorEqualsdotTimes, dotTimesEquals, equals, equals, isZero, isZero, minus, minusEquals, negative, negativeEquals, plus, plusEquals, scale, scaledMinus, scaledMinusEquals, scaledPlus, scaledPlusEquals, scaleEquals, zeroconvertFromVector, convertToVectorpublic Vector3()
public Vector3(double x,
double y,
double z)
x - The x-coordinate.y - The y-coordinate.z - The z-coordinate.public Vector3(Vector other)
other - The other vector to copy.public Vector3(Vector3D other)
other - The other vector to copy.public Vector3 clone()
AbstractCloneableSerializableObject class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone() to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone() as the basis for your implementation.clone in interface Vectorclone in interface Vectorizableclone in interface Ring<Vector>clone in interface CloneableSerializableclone in class AbstractMTJVectorpublic int getDimensionality()
VectorgetDimensionality in interface VectorgetDimensionality in class DenseVectorpublic double getX()
Vector3Dpublic void setX(double x)
Vector3Dpublic double getY()
Vector3Dpublic void setY(double y)
Vector3Dpublic double getZ()
Vector3Dpublic void setZ(double z)
Vector3Dpublic void setXYZ(double x,
double y,
double z)
Vector3Dpublic java.lang.String toString()
toString in interface VectortoString in class AbstractVectorpublic static Vector3 createRandom(java.util.Random random)
random - The random number generator to use.public java.lang.Double getFirst()
Triplepublic java.lang.Double getSecond()
Triple