|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IVector2
Interface for cartesian 2-vectors NOTE: All operations on the vector are destructive and the instance returned is the same as the one whose method was called. If you require a copy of the vector before performing operations on it, use the copy constructor, the copy method or the clone interface.
| Method Summary | |
|---|---|
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. |
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(Object obj)
Compares the vector to an object |
IVector1 |
getDirection()
Returns the direction (theta) of the vector. |
double |
getDirectionAsDouble()
Returns the direction (theta) of the vector as double. |
float |
getDirectionAsFloat()
Returns the direction (theta) of the vector as float. |
IVector1 |
getDistance(IVector2 vector)
Returns the distance to another vector. |
IVector1 |
getLength()
Returns the length (magnitude) of the vector. |
IVector1 |
getMean()
Returns the mean average of the vector components. |
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. |
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 |
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. |
| Method Detail |
|---|
IVector2 assign(IVector2 vector)
vector - the other vector
IVector2 add(double scalar)
scalar - scalar value as double
IVector2 add(IVector1 scalar)
scalar - scalar value
IVector2 add(IVector2 vector)
vector - the vector to add to this vector
IVector2 subtract(double scalar)
scalar - scalar value as double
IVector2 subtract(IVector1 scalar)
scalar - scalar value
IVector2 subtract(IVector2 vector)
vector - the vector to subtract from this vector
IVector2 mod(IVector2 modulus)
modulus - modulus
IVector2 multiply(double scalar)
scalar - the scale factor double
IVector2 multiply(IVector1 scalar)
scalar - the scale factor
IVector2 multiply(IVector2 vector)
vector - vector
IVector2 divide(IVector2 vector)
vector - vector
IVector2 zero()
IVector2 negateX()
IVector2 negateY()
IVector2 negate()
IVector2 randomX(IVector1 lower,
IVector1 upper)
IVector2 randomY(IVector1 lower,
IVector1 upper)
IVector2 normalize()
IVector1 getLength()
IVector1 getDirection()
float getDirectionAsFloat()
double getDirectionAsDouble()
IVector1 getMean()
IVector1 getDistance(IVector2 vector)
vector - other vector
IVector1 getX()
IVector1 getY()
int getXAsInteger()
int getYAsInteger()
long getXAsLong()
long getYAsLong()
float getXAsFloat()
float getYAsFloat()
double getXAsDouble()
double getYAsDouble()
BigDecimal getXAsBigDecimal()
BigDecimal getYAsBigDecimal()
IVector2 copy()
Object clone()
throws CloneNotSupportedException
CloneNotSupportedExceptionboolean equals(Object obj)
equals in class Objectobj - the object
boolean equals(IVector2 vector)
vector - the other vector
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||