|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjadex.application.space.envsupport.math.Vector3Double
public class Vector3Double
Implementation of a cartesian 3-vector using double components.
| Field Summary | |
|---|---|
static IVector3 |
ZERO
Zero vector. |
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
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. |
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(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(Double a,
Double b,
Double c)
Get a vector for two doubles. |
IVector1 |
getX()
Returns the x-component of the vector. |
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. |
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. |
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. |
String |
toString()
|
IVector3 |
zero()
Sets all vector components to zero. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final IVector3 ZERO
| Constructor Detail |
|---|
public Vector3Double()
public Vector3Double(IVector3 vector)
public Vector3Double(double scalar)
public Vector3Double(double x,
double y,
double z)
| Method Detail |
|---|
public IVector3 assign(IVector3 vector)
assign in interface IVector3vector - the other vector
public IVector3 add(double scalar)
IVector3
add in interface IVector3scalar - scalar value as double
public IVector3 add(IVector1 scalar)
IVector3
add in interface IVector3scalar - scalar value
public IVector3 add(IVector3 vector)
IVector3
add in interface IVector3vector - the vector to add to this vector
public IVector3 subtract(double scalar)
IVector3
subtract in interface IVector3scalar - scalar value as double
public IVector3 subtract(IVector1 scalar)
IVector3
subtract in interface IVector3scalar - scalar value
public IVector3 subtract(IVector3 vector)
IVector3
subtract in interface IVector3vector - the vector to subtract from this vector
public IVector3 mod(IVector3 modulus)
IVector3
mod in interface IVector3modulus - modulus
public IVector3 multiply(double scalar)
IVector3
multiply in interface IVector3scalar - the scale factor double
public IVector3 multiply(IVector1 scalar)
IVector3
multiply in interface IVector3scalar - the scale factor
public IVector3 multiply(IVector3 vector)
IVector3
multiply in interface IVector3vector - vector
public IVector3 divide(IVector3 vector)
divide in interface IVector3vector - vector
public IVector3 zero()
IVector3
zero in interface IVector3public IVector3 negateX()
IVector3
negateX in interface IVector3public IVector3 negateY()
IVector3
negateY in interface IVector3public IVector3 negateZ()
IVector3
negateZ in interface IVector3public IVector3 negate()
IVector3
negate in interface IVector3
public IVector3 randomX(IVector1 lower,
IVector1 upper)
IVector3
randomX in interface IVector3
public IVector3 randomY(IVector1 lower,
IVector1 upper)
IVector3
randomY in interface IVector3
public IVector3 randomZ(IVector1 lower,
IVector1 upper)
IVector3
randomZ in interface IVector3public IVector3 normalize()
IVector3
normalize in interface IVector3public IVector1 getLength()
IVector3
getLength in interface IVector3public IVector2 getDirection()
IVector3
getDirection in interface IVector3public IVector1 getDistance(IVector3 vector)
IVector3
getDistance in interface IVector3vector - other vector
public IVector1 getX()
IVector3
getX in interface IVector3public IVector1 getY()
IVector3
getY in interface IVector3public IVector1 getZ()
IVector3
getZ in interface IVector3public void setX(IVector1 x)
public void setY(IVector1 y)
public void setZ(IVector1 z)
public int getXAsInteger()
getXAsInteger in interface IVector3public int getYAsInteger()
getYAsInteger in interface IVector3public int getZAsInteger()
getZAsInteger in interface IVector3public long getXAsLong()
getXAsLong in interface IVector3public long getYAsLong()
getYAsLong in interface IVector3public long getZAsLong()
getZAsLong in interface IVector3public float getXAsFloat()
IVector3
getXAsFloat in interface IVector3public float getYAsFloat()
IVector3
getYAsFloat in interface IVector3public float getZAsFloat()
IVector3
getZAsFloat in interface IVector3public double getXAsDouble()
IVector3
getXAsDouble in interface IVector3public double getYAsDouble()
IVector3
getYAsDouble in interface IVector3public double getZAsDouble()
IVector3
getZAsDouble in interface IVector3public BigDecimal getXAsBigDecimal()
IVector3
getXAsBigDecimal in interface IVector3public BigDecimal getYAsBigDecimal()
IVector3
getYAsBigDecimal in interface IVector3public BigDecimal getZAsBigDecimal()
IVector3
getZAsBigDecimal in interface IVector3public IVector3 copy()
IVector3
copy in interface IVector3
public Object clone()
throws CloneNotSupportedException
IVector3
clone in interface IVector3clone in class ObjectCloneNotSupportedExceptionpublic boolean equals(Object obj)
IVector3
equals in interface IVector3equals in class Objectobj - the object
public boolean equals(IVector3 vector)
IVector3
equals in interface IVector3vector - the other vector
public int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
public static IVector3 getVector3(Double a,
Double b,
Double c)
a - The first value.b - The second value.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||