public interface IVector2
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.
|
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.
|
IVector2 |
zero()
Sets all vector components to zero.
|
IVector2 assign(IVector2 vector)
vector
- the other vectorIVector2 add(double scalar)
scalar
- scalar value as doubleIVector2 add(IVector1 scalar)
scalar
- scalar valueIVector2 add(IVector2 vector)
vector
- the vector to add to this vectorIVector2 subtract(double scalar)
scalar
- scalar value as doubleIVector2 subtract(IVector1 scalar)
scalar
- scalar valueIVector2 subtract(IVector2 vector)
vector
- the vector to subtract from this vectorIVector2 mod(IVector2 modulus)
modulus
- modulusIVector2 multiply(double scalar)
scalar
- the scale factor doubleIVector2 multiply(IVector1 scalar)
scalar
- the scale factorIVector2 multiply(IVector2 vector)
vector
- vectorIVector2 divide(IVector2 vector)
vector
- vectorIVector2 zero()
IVector2 negateX()
IVector2 negateY()
IVector2 negate()
IVector2 randomX(IVector1 lower, IVector1 upper)
IVector2 randomY(IVector1 lower, IVector1 upper)
IVector2 normalize()
IVector2 redirect(double angle)
angle
- The new direction.double getInnerProductAsDouble(IVector2 vector)
IVector1 getLength()
IVector1 getSquaredLength()
IVector1 getDirection(IVector2 vector)
float getDirectionAsFloat(IVector2 vector)
double getDirectionAsDouble(IVector2 vector)
IVector1 getDirection()
float getDirectionAsFloat()
double getDirectionAsDouble()
IVector1 getMean()
IVector1 getDistance(IVector2 vector)
vector
- other vectorIVector1 getX()
IVector1 getY()
int getXAsInteger()
int getYAsInteger()
long getXAsLong()
long getYAsLong()
float getXAsFloat()
float getYAsFloat()
double getXAsDouble()
double getYAsDouble()
java.math.BigDecimal getXAsBigDecimal()
java.math.BigDecimal getYAsBigDecimal()
IVector2 copy()
java.lang.Object clone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the objectboolean equals(IVector2 vector)
vector
- the other vector