Constructor and Description |
---|
SynchronizedVector2Wrapper(IVector2 vector) |
Modifier and Type | Method and Description |
---|---|
IVector2 |
add(double scalar)
Adds a scalar to each component of this vector.
|
IVector2 |
add(IVector1 scalar)
Adds a scalar to each component of this vector.
|
IVector2 |
add(IVector2 vector)
Adds another vector to this vector, adding individual components.
|
IVector2 |
assign(IVector2 vector)
Assigns this vector the values of another vector.
|
java.lang.Object |
clone()
Generates a deep clone of the vector.
|
IVector2 |
copy()
Makes a copy of the vector without using the complex clone interface.
|
IVector2 |
divide(IVector2 vector)
Performs a division on the vector.
|
boolean |
equals(IVector2 vector)
Compares the vector to another vector.
|
boolean |
equals(java.lang.Object obj)
Compares the vector to an object
|
IVector1 |
getDirection()
Returns the direction (theta) of the vector.
|
IVector1 |
getDirection(IVector2 vector)
Returns the direction (theta) of the vector.
|
double |
getDirectionAsDouble()
Returns the direction (theta) of the vector as double.
|
double |
getDirectionAsDouble(IVector2 vector)
Returns the direction (theta) of the vector as double.
|
float |
getDirectionAsFloat()
Returns the direction (theta) of the vector as float.
|
float |
getDirectionAsFloat(IVector2 vector)
Returns the direction (theta) of the vector as float.
|
IVector1 |
getDistance(IVector2 vector)
Returns the distance to another vector.
|
double |
getInnerProductAsDouble(IVector2 vector)
Returns the length (magnitude) of the vector.
|
IVector1 |
getLength()
Returns the length (magnitude) of the vector.
|
IVector1 |
getMean()
Returns the mean average of the vector components.
|
IVector1 |
getSquaredLength()
Returns the squared length (magnitude) of the vector.
|
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.
|
int |
hashCode()
Get the hash code.
|
IVector2 |
mod(IVector2 modulus)
Applies a modulo vector.
|
IVector2 |
multiply(double scalar)
Performs a scalar multiplication (scaling) on the vector.
|
IVector2 |
multiply(IVector1 scalar)
Performs a scalar multiplication (scaling) on the vector.
|
IVector2 |
multiply(IVector2 vector)
Performs a multiplication on the vector.
|
IVector2 |
negate()
Negates the vector by negating its components.
|
IVector2 |
negateX()
Negates the x-component.
|
IVector2 |
negateY()
Negates the y-component.
|
IVector2 |
normalize()
Converts the vector to a unit vector (normalization)
|
IVector2 |
randomX(IVector1 lower,
IVector1 upper)
Sets the x-component to a random value in the interval [lower,upper]
|
IVector2 |
randomY(IVector1 lower,
IVector1 upper)
Sets the y-component to a random value in the interval [lower,upper]
|
IVector2 |
redirect(double angle)
Redirects the vector to a new direction,
maintaining the magnitude.
|
IVector2 |
subtract(double scalar)
Subtracts a scalar to each component of this vector.
|
IVector2 |
subtract(IVector1 scalar)
Subtracts a scalar to each component of this vector.
|
IVector2 |
subtract(IVector2 vector)
Subtracts another vector to this vector, subtracting individual components.
|
java.lang.String |
toString() |
IVector2 |
zero()
Sets all vector components to zero.
|
public SynchronizedVector2Wrapper(IVector2 vector)
public IVector2 add(double scalar)
public IVector2 add(IVector2 vector)
public IVector2 subtract(double scalar)
public IVector2 subtract(IVector1 scalar)
public IVector2 subtract(IVector2 vector)
public IVector2 mod(IVector2 modulus)
public IVector2 multiply(double scalar)
public IVector2 multiply(IVector1 scalar)
public IVector2 zero()
public IVector2 negateX()
public IVector2 negateY()
public IVector2 negate()
public IVector2 randomX(IVector1 lower, IVector1 upper)
public IVector2 randomY(IVector1 lower, IVector1 upper)
public IVector2 normalize()
public IVector2 redirect(double angle)
public IVector1 getLength()
public IVector1 getSquaredLength()
getSquaredLength
in interface IVector2
public IVector1 getDirection()
getDirection
in interface IVector2
public float getDirectionAsFloat()
getDirectionAsFloat
in interface IVector2
public double getDirectionAsDouble()
getDirectionAsDouble
in interface IVector2
public IVector1 getMean()
public IVector1 getDistance(IVector2 vector)
getDistance
in interface IVector2
vector
- other vectorpublic IVector1 getX()
public IVector1 getY()
public int getXAsInteger()
getXAsInteger
in interface IVector2
public int getYAsInteger()
getYAsInteger
in interface IVector2
public long getXAsLong()
getXAsLong
in interface IVector2
public long getYAsLong()
getYAsLong
in interface IVector2
public float getXAsFloat()
getXAsFloat
in interface IVector2
public float getYAsFloat()
getYAsFloat
in interface IVector2
public double getXAsDouble()
getXAsDouble
in interface IVector2
public double getYAsDouble()
getYAsDouble
in interface IVector2
public java.math.BigDecimal getXAsBigDecimal()
getXAsBigDecimal
in interface IVector2
public java.math.BigDecimal getYAsBigDecimal()
getYAsBigDecimal
in interface IVector2
public IVector2 copy()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
public boolean equals(IVector2 vector)
public java.lang.String toString()
toString
in class java.lang.Object
public double getInnerProductAsDouble(IVector2 vector)
IVector2
getInnerProductAsDouble
in interface IVector2
public IVector1 getDirection(IVector2 vector)
IVector2
getDirection
in interface IVector2
public float getDirectionAsFloat(IVector2 vector)
IVector2
getDirectionAsFloat
in interface IVector2
public double getDirectionAsDouble(IVector2 vector)
IVector2
getDirectionAsDouble
in interface IVector2