Package jadex.extension.envsupport.math
Class Vector2Double
- java.lang.Object
- 
- jadex.extension.envsupport.math.Vector2Double
 
- 
- 
Constructor SummaryConstructors Constructor Description Vector2Double()Creates a new Vector2Double with the value (0,0).Vector2Double(double scalar)Creates a new Vector2 using the scalar to assign the value (scalar,scalar).Vector2Double(double x, double y)Creates a new Vector2 with the given value.Vector2Double(IVector2 vector)Creates a new Vector2 with the same value as the input vector.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IVector2add(double scalar)Adds a scalar to each component of this vector.IVector2add(IVector1 scalar)Adds a scalar to each component of this vector.IVector2add(IVector2 vector)Adds another vector to this vector, adding individual components.IVector2assign(IVector2 vector)Assigns this vector the values of another vector.java.lang.Objectclone()Generates a deep clone of the vector.IVector2copy()Makes a copy of the vector without using the complex clone interface.IVector2divide(IVector2 vector)Performs a division on the vector.booleanequals(IVector2 vector)Compares the vector to another vector.booleanequals(java.lang.Object obj)Compares the vector to an objectIVector1getDirection()Returns the direction (theta) of the vector.IVector1getDirection(IVector2 vector)Returns the direction (theta) of the vector.doublegetDirectionAsDouble()Returns the direction (theta) of the vector as double.doublegetDirectionAsDouble(IVector2 vector)Returns the direction (theta) of the vector as double.floatgetDirectionAsFloat()Returns the direction (theta) of the vector as float.floatgetDirectionAsFloat(IVector2 vector)Returns the direction (theta) of the vector as float.IVector1getDistance(IVector2 vector)Returns the distance to another vector.doublegetInnerProductAsDouble(IVector2 vector)Returns the length (magnitude) of the vector.IVector1getLength()Returns the length (magnitude) of the vector.IVector1getMean()Returns the mean average of the vector components.IVector1getSquaredLength()Returns the squared length (magnitude) of the vector.static IVector2getVector2(java.lang.Double a, java.lang.Double b)Get a vector for two doubles.Vector3DoublegetVector3DoubleValueNoHight()IVector1getX()Returns the x-component of the vector.java.math.BigDecimalgetXAsBigDecimal()Returns the x-component of the vector as BigDecimal.doublegetXAsDouble()Returns the x-component of the vector as double.floatgetXAsFloat()Returns the x-component of the vector as float.intgetXAsInteger()Returns the x-component of the vector as integer.longgetXAsLong()Returns the x-component of the vector as long.IVector1getY()Returns the y-component of the vector.java.math.BigDecimalgetYAsBigDecimal()Returns the component of the vector as BigDecima;.doublegetYAsDouble()Returns the component of the vector as double.floatgetYAsFloat()Returns the component of the vector as float.intgetYAsInteger()Returns the component of the vector as integer.longgetYAsLong()Returns the component of the vector as float.inthashCode()Compute the hash code.IVector2mod(IVector2 modulus)Applies a modulo vector.IVector2multiply(double scalar)Performs a scalar multiplication (scaling) on the vector.IVector2multiply(IVector1 scalar)Performs a scalar multiplication (scaling) on the vector.IVector2multiply(IVector2 vector)Performs a multiplication on the vector.IVector2negate()Negates the vector by negating its components.IVector2negateX()Negates the x-component.IVector2negateY()Negates the y-component.IVector2normalize()Converts the vector to a unit vector (normalization)IVector2randomX(IVector1 lower, IVector1 upper)Sets the x-component to a random value in the interval [lower,upper]IVector2randomY(IVector1 lower, IVector1 upper)Sets the y-component to a random value in the interval [lower,upper]IVector2redirect(double angle)Redirects the vector to a new direction, maintaining the magnitude.voidsetX(IVector1 x)voidsetY(IVector1 y)IVector2subtract(double scalar)Subtracts a scalar to each component of this vector.IVector2subtract(IVector1 scalar)Subtracts a scalar to each component of this vector.IVector2subtract(IVector2 vector)Subtracts another vector to this vector, subtracting individual components.java.lang.StringtoString()IVector2zero()Sets all vector components to zero.
 
- 
- 
- 
Field Detail- 
ZEROpublic static final IVector2 ZERO Zero vector.
 
- 
 - 
Constructor Detail- 
Vector2Doublepublic Vector2Double() Creates a new Vector2Double with the value (0,0).
 - 
Vector2Doublepublic Vector2Double(IVector2 vector) Creates a new Vector2 with the same value as the input vector.
 - 
Vector2Doublepublic Vector2Double(double scalar) Creates a new Vector2 using the scalar to assign the value (scalar,scalar).
 - 
Vector2Doublepublic Vector2Double(double x, double y)Creates a new Vector2 with the given value.
 
- 
 - 
Method Detail- 
addpublic IVector2 add(double scalar) Description copied from interface:IVector2Adds a scalar to each component of this vector.
 - 
addpublic IVector2 add(IVector1 scalar) Description copied from interface:IVector2Adds a scalar to each component of this vector.
 - 
addpublic IVector2 add(IVector2 vector) Description copied from interface:IVector2Adds another vector to this vector, adding individual components.
 - 
subtractpublic IVector2 subtract(double scalar) Description copied from interface:IVector2Subtracts a scalar to each component of this vector.
 - 
subtractpublic IVector2 subtract(IVector1 scalar) Description copied from interface:IVector2Subtracts a scalar to each component of this vector.
 - 
subtractpublic IVector2 subtract(IVector2 vector) Description copied from interface:IVector2Subtracts another vector to this vector, subtracting individual components.
 - 
modpublic IVector2 mod(IVector2 modulus) Description copied from interface:IVector2Applies a modulo vector. The modulus will be added first so that values in the interval (-modulus, 0) will wrap over into the positive range.
 - 
multiplypublic IVector2 multiply(double scalar) Description copied from interface:IVector2Performs a scalar multiplication (scaling) on the vector.
 - 
multiplypublic IVector2 multiply(IVector1 scalar) Description copied from interface:IVector2Performs a scalar multiplication (scaling) on the vector.
 - 
multiplypublic IVector2 multiply(IVector2 vector) Description copied from interface:IVector2Performs a multiplication on the vector.
 - 
zeropublic IVector2 zero() Description copied from interface:IVector2Sets all vector components to zero.
 - 
negateXpublic IVector2 negateX() Description copied from interface:IVector2Negates the x-component.
 - 
negateYpublic IVector2 negateY() Description copied from interface:IVector2Negates the y-component.
 - 
negatepublic IVector2 negate() Description copied from interface:IVector2Negates the vector by negating its components.
 - 
randomXpublic IVector2 randomX(IVector1 lower, IVector1 upper) Description copied from interface:IVector2Sets the x-component to a random value in the interval [lower,upper]
 - 
randomYpublic IVector2 randomY(IVector1 lower, IVector1 upper) Description copied from interface:IVector2Sets the y-component to a random value in the interval [lower,upper]
 - 
normalizepublic IVector2 normalize() Description copied from interface:IVector2Converts the vector to a unit vector (normalization)
 - 
redirectpublic IVector2 redirect(double angle) Redirects the vector to a new direction, maintaining the magnitude.
 - 
getLengthpublic IVector1 getLength() Description copied from interface:IVector2Returns the length (magnitude) of the vector.
 - 
getSquaredLengthpublic IVector1 getSquaredLength() Returns the squared length (magnitude) of the vector.- Specified by:
- getSquaredLengthin interface- IVector2
- Returns:
- squared vector length
 
 - 
getDirectionpublic IVector1 getDirection() Description copied from interface:IVector2Returns the direction (theta) of the vector.- Specified by:
- getDirectionin interface- IVector2
- Returns:
- vector direction
 
 - 
getDirectionAsFloatpublic float getDirectionAsFloat() Description copied from interface:IVector2Returns the direction (theta) of the vector as float.- Specified by:
- getDirectionAsFloatin interface- IVector2
- Returns:
- vector direction as float
 
 - 
getDirectionAsDoublepublic double getDirectionAsDouble() Description copied from interface:IVector2Returns the direction (theta) of the vector as double.- Specified by:
- getDirectionAsDoublein interface- IVector2
- Returns:
- vector direction as double
 
 - 
getMeanpublic IVector1 getMean() Description copied from interface:IVector2Returns the mean average of the vector components.
 - 
getDistancepublic IVector1 getDistance(IVector2 vector) Description copied from interface:IVector2Returns the distance to another vector.- Specified by:
- getDistancein interface- IVector2
- Parameters:
- vector- other vector
- Returns:
- distance
 
 - 
getXpublic IVector1 getX() Description copied from interface:IVector2Returns the x-component of the vector.
 - 
getYpublic IVector1 getY() Description copied from interface:IVector2Returns the y-component of the vector.
 - 
setXpublic void setX(IVector1 x) 
 - 
setYpublic void setY(IVector1 y) 
 - 
getXAsIntegerpublic int getXAsInteger() Returns the x-component of the vector as integer.- Specified by:
- getXAsIntegerin interface- IVector2
- Returns:
- x-component as integer
 
 - 
getYAsIntegerpublic int getYAsInteger() Returns the component of the vector as integer.- Specified by:
- getYAsIntegerin interface- IVector2
- Returns:
- y-component as float
 
 - 
getXAsLongpublic long getXAsLong() Returns the x-component of the vector as long.- Specified by:
- getXAsLongin interface- IVector2
- Returns:
- x-component as long
 
 - 
getYAsLongpublic long getYAsLong() Returns the component of the vector as float.- Specified by:
- getYAsLongin interface- IVector2
- Returns:
- y-component as float
 
 - 
getXAsFloatpublic float getXAsFloat() Description copied from interface:IVector2Returns the x-component of the vector as float.- Specified by:
- getXAsFloatin interface- IVector2
- Returns:
- x-component as float
 
 - 
getYAsFloatpublic float getYAsFloat() Description copied from interface:IVector2Returns the component of the vector as float.- Specified by:
- getYAsFloatin interface- IVector2
- Returns:
- y-component as float
 
 - 
getXAsDoublepublic double getXAsDouble() Description copied from interface:IVector2Returns the x-component of the vector as double.- Specified by:
- getXAsDoublein interface- IVector2
- Returns:
- x-component as double
 
 - 
getYAsDoublepublic double getYAsDouble() Description copied from interface:IVector2Returns the component of the vector as double.- Specified by:
- getYAsDoublein interface- IVector2
- Returns:
- y-component as double
 
 - 
getXAsBigDecimalpublic java.math.BigDecimal getXAsBigDecimal() Description copied from interface:IVector2Returns the x-component of the vector as BigDecimal.- Specified by:
- getXAsBigDecimalin interface- IVector2
- Returns:
- x-component as BigDecimal
 
 - 
getYAsBigDecimalpublic java.math.BigDecimal getYAsBigDecimal() Description copied from interface:IVector2Returns the component of the vector as BigDecima;.- Specified by:
- getYAsBigDecimalin interface- IVector2
- Returns:
- y-component as BigDecimal
 
 - 
copypublic IVector2 copy() Description copied from interface:IVector2Makes a copy of the vector without using the complex clone interface.
 - 
clonepublic java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionDescription copied from interface:IVector2Generates a deep clone of the vector.
 - 
equalspublic boolean equals(java.lang.Object obj) Description copied from interface:IVector2Compares the vector to an object
 - 
equalspublic boolean equals(IVector2 vector) Description copied from interface:IVector2Compares the vector to another vector. The vectors are equal if the components are equal.
 - 
hashCodepublic int hashCode() Compute the hash code.- Overrides:
- hashCodein class- java.lang.Object
- Returns:
- The hash code.
 
 - 
getVector3DoubleValueNoHightpublic Vector3Double getVector3DoubleValueNoHight() 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 - 
getVector2public static IVector2 getVector2(java.lang.Double a, java.lang.Double b) Get a vector for two doubles.- Parameters:
- a- The first value.
- b- The second value.
- Returns:
- The vector (null if at least one of args is null).
 
 - 
getInnerProductAsDoublepublic double getInnerProductAsDouble(IVector2 vector) Description copied from interface:IVector2Returns the length (magnitude) of the vector.- Specified by:
- getInnerProductAsDoublein interface- IVector2
- Returns:
- vector length
 
 - 
getDirectionpublic IVector1 getDirection(IVector2 vector) Description copied from interface:IVector2Returns the direction (theta) of the vector.- Specified by:
- getDirectionin interface- IVector2
- Returns:
- vector direction
 
 - 
getDirectionAsDoublepublic double getDirectionAsDouble(IVector2 vector) Description copied from interface:IVector2Returns the direction (theta) of the vector as double.- Specified by:
- getDirectionAsDoublein interface- IVector2
- Returns:
- vector direction as double
 
 - 
getDirectionAsFloatpublic float getDirectionAsFloat(IVector2 vector) Description copied from interface:IVector2Returns the direction (theta) of the vector as float.- Specified by:
- getDirectionAsFloatin interface- IVector2
- Returns:
- vector direction as float
 
 
- 
 
-