Constructor and Description |
---|
Vector3Double()
Creates a new Vector2Double with the value (0,0).
|
Vector3Double(double scalar)
Creates a new Vector2 using the scalar to assign the
value (scalar,scalar).
|
Vector3Double(double x,
double y,
double z)
Creates a new Vector2 with the given value.
|
Vector3Double(IVector3 vector)
Creates a new Vector3 with the same value as the input vector.
|
Modifier and Type | Method and Description |
---|---|
IVector3 |
add(double scalar)
Adds a scalar to each component of this vector.
|
IVector3 |
add(IVector1 scalar)
Adds a scalar to each component of this vector.
|
IVector3 |
add(IVector3 vector)
Adds another vector to this vector, adding individual components.
|
IVector3 |
assign(IVector3 vector)
Assigns this vector the values of another vector.
|
java.lang.Object |
clone()
Generates a deep clone of the vector.
|
IVector3 |
copy()
Makes a copy of the vector without using the complex clone interface.
|
IVector3 |
divide(IVector3 vector)
Performs a division on the vector.
|
boolean |
equals(IVector3 vector)
Compares the vector to another vector.
|
boolean |
equals(java.lang.Object obj)
Compares the vector to an object
|
IVector2 |
getDirection()
Returns the direction (theta) of the vector.
|
IVector1 |
getDistance(IVector3 vector)
Returns the distance to another vector.
|
IVector1 |
getLength()
Returns the length (magnitude) of the vector.
|
static IVector3 |
getVector3(java.lang.Double x,
java.lang.Double y,
java.lang.Double z)
Get a vector for three doubles.
|
IVector1 |
getX()
Returns the x-component of the vector.
|
java.math.BigDecimal |
getXAsBigDecimal()
Returns the x-component of the vector as BigDecimal.
|
double |
getXAsDouble()
Returns the x-component of the vector as double.
|
float |
getXAsFloat()
Returns the x-component of the vector as float.
|
int |
getXAsInteger()
Returns the x-component of the vector as integer.
|
long |
getXAsLong()
Returns the x-component of the vector as long.
|
IVector1 |
getY()
Returns the y-component of the vector.
|
java.math.BigDecimal |
getYAsBigDecimal()
Returns the component of the vector as BigDecima;.
|
double |
getYAsDouble()
Returns the component of the vector as double.
|
float |
getYAsFloat()
Returns the component of the vector as float.
|
int |
getYAsInteger()
Returns the component of the vector as integer.
|
long |
getYAsLong()
Returns the component of the vector as float.
|
IVector1 |
getZ()
Returns the z-component of the vector.
|
java.math.BigDecimal |
getZAsBigDecimal()
Returns the component of the vector as BigDecima;.
|
double |
getZAsDouble()
Returns the component of the vector as double.
|
float |
getZAsFloat()
Returns the component of the vector as float.
|
int |
getZAsInteger()
Returns the component of the vector as integer.
|
long |
getZAsLong()
Returns the component of the vector as float.
|
int |
hashCode()
Compute the hash code.
|
IVector3 |
mod(IVector3 modulus)
Applies a modulo vector.
|
IVector3 |
multiply(double scalar)
Performs a scalar multiplication (scaling) on the vector.
|
IVector3 |
multiply(IVector1 scalar)
Performs a scalar multiplication (scaling) on the vector.
|
IVector3 |
multiply(IVector3 vector)
Performs a multiplication on the vector.
|
IVector3 |
negate()
Negates the vector by negating its components.
|
IVector3 |
negateX()
Negates the x-component.
|
IVector3 |
negateY()
Negates the y-component.
|
IVector3 |
negateZ()
Negates the z-component.
|
IVector3 |
normalize()
Converts the vector to a unit vector (normalization)
|
IVector3 |
randomX(IVector1 lower,
IVector1 upper)
Sets the x-component to a random value in the interval [lower,upper]
|
IVector3 |
randomY(IVector1 lower,
IVector1 upper)
Sets the y-component to a random value in the interval [lower,upper]
|
IVector3 |
randomZ(IVector1 lower,
IVector1 upper)
Sets the z-component to a random value in the interval [lower,upper]
|
void |
setX(IVector1 x) |
void |
setY(IVector1 y) |
void |
setZ(IVector1 z) |
IVector3 |
subtract(double scalar)
Subtracts a scalar to each component of this vector.
|
IVector3 |
subtract(IVector1 scalar)
Subtracts a scalar to each component of this vector.
|
IVector3 |
subtract(IVector3 vector)
Subtracts another vector to this vector, subtracting individual components.
|
java.lang.String |
toString() |
IVector3 |
zero()
Sets all vector components to zero.
|
public static final IVector3 ZERO
public Vector3Double()
public Vector3Double(IVector3 vector)
public Vector3Double(double scalar)
public Vector3Double(double x, double y, double z)
public IVector3 add(double scalar)
IVector3
public IVector3 add(IVector1 scalar)
IVector3
public IVector3 add(IVector3 vector)
IVector3
public IVector3 subtract(double scalar)
IVector3
public IVector3 subtract(IVector1 scalar)
IVector3
public IVector3 subtract(IVector3 vector)
IVector3
public IVector3 mod(IVector3 modulus)
IVector3
public IVector3 multiply(double scalar)
IVector3
public IVector3 multiply(IVector1 scalar)
IVector3
public IVector3 multiply(IVector3 vector)
IVector3
public IVector3 zero()
IVector3
public IVector3 negateX()
IVector3
public IVector3 negateY()
IVector3
public IVector3 negateZ()
IVector3
public IVector3 negate()
IVector3
public IVector3 randomX(IVector1 lower, IVector1 upper)
IVector3
public IVector3 randomY(IVector1 lower, IVector1 upper)
IVector3
public IVector3 randomZ(IVector1 lower, IVector1 upper)
IVector3
public IVector3 normalize()
IVector3
public IVector1 getLength()
IVector3
public IVector2 getDirection()
IVector3
getDirection
in interface IVector3
public IVector1 getDistance(IVector3 vector)
IVector3
getDistance
in interface IVector3
vector
- other vectorpublic IVector1 getX()
IVector3
public IVector1 getY()
IVector3
public IVector1 getZ()
IVector3
public void setX(IVector1 x)
public void setY(IVector1 y)
public void setZ(IVector1 z)
public int getXAsInteger()
getXAsInteger
in interface IVector3
public int getYAsInteger()
getYAsInteger
in interface IVector3
public int getZAsInteger()
getZAsInteger
in interface IVector3
public long getXAsLong()
getXAsLong
in interface IVector3
public long getYAsLong()
getYAsLong
in interface IVector3
public long getZAsLong()
getZAsLong
in interface IVector3
public float getXAsFloat()
IVector3
getXAsFloat
in interface IVector3
public float getYAsFloat()
IVector3
getYAsFloat
in interface IVector3
public float getZAsFloat()
IVector3
getZAsFloat
in interface IVector3
public double getXAsDouble()
IVector3
getXAsDouble
in interface IVector3
public double getYAsDouble()
IVector3
getYAsDouble
in interface IVector3
public double getZAsDouble()
IVector3
getZAsDouble
in interface IVector3
public java.math.BigDecimal getXAsBigDecimal()
IVector3
getXAsBigDecimal
in interface IVector3
public java.math.BigDecimal getYAsBigDecimal()
IVector3
getYAsBigDecimal
in interface IVector3
public java.math.BigDecimal getZAsBigDecimal()
IVector3
getZAsBigDecimal
in interface IVector3
public IVector3 copy()
IVector3
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
IVector3
public boolean equals(java.lang.Object obj)
IVector3
public boolean equals(IVector3 vector)
IVector3
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static IVector3 getVector3(java.lang.Double x, java.lang.Double y, java.lang.Double z)
x
- The first value.y
- The second value.z
- The second value