Class PathVector
java.lang.Object
de.metaphoriker.pathetic.api.wrapper.PathVector
- All Implemented Interfaces:
Cloneable
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd
(PathVector otherVector) Adds two vectors togetherprotected boolean
clone()
static double
computeDistance
(PathVector A, PathVector B, PathVector C) Finds the distance between the line BC and the point Adouble
distance
(PathVector otherVector) Gets the distance between this vector and another vectordivide
(double value) Divide the vector by a scalar constantdouble
dot
(PathVector otherVector) Calculates the dot product of two vectorsboolean
Calculates the cross product of two vectorsdouble
getX()
double
getY()
double
getZ()
int
hashCode()
double
length()
Gets the length of thePathVector
multiply
(double value) Multiplies itself by a scalar constantNormalises thePathVector
(Divides the components by its magnitude)setX
(double x) Sets the x component of the vectorsetY
(double y) Sets the y component of the vectorsetZ
(double z) Sets the z component of the vectorsubtract
(PathVector otherVector) Subtracts one vector from another
-
Constructor Details
-
PathVector
public PathVector(double x, double y, double z)
-
-
Method Details
-
computeDistance
Finds the distance between the line BC and the point A- Parameters:
A
- The pointB
- The first point of the lineC
- The second point of the line- Returns:
- The distance
-
dot
Calculates the dot product of two vectors- Parameters:
otherVector
- The other vector- Returns:
- The dot product
-
length
public double length()Gets the length of thePathVector
- Returns:
- The length
-
distance
Gets the distance between this vector and another vector- Parameters:
otherVector
- The other vector- Returns:
- The distance
-
setX
Sets the x component of the vector- Parameters:
x
- The x component- Returns:
- A new
PathVector
-
setY
Sets the y component of the vector- Parameters:
y
- The y component- Returns:
- A new
PathVector
-
setZ
Sets the z component of the vector- Parameters:
z
- The z component- Returns:
- A new
PathVector
-
subtract
Subtracts one vector from another- Parameters:
otherVector
-PathVector
to vector to subtract from the current Vector- Returns:
- A new
PathVector
-
multiply
Multiplies itself by a scalar constant- Parameters:
value
- The constant to multiply by- Returns:
- A new
PathVector
-
normalize
Normalises thePathVector
(Divides the components by its magnitude)- Returns:
- A new
PathVector
-
divide
Divide the vector by a scalar constant- Parameters:
value
- The constant to divide by- Returns:
- A new
PathVector
-
add
Adds two vectors together- Parameters:
otherVector
- The other vector- Returns:
- A new
PathVector
-
getCrossProduct
Calculates the cross product of two vectors- Parameters:
o
- The other vector- Returns:
- The cross product vector
-
clone
-
getX
public double getX() -
getY
public double getY() -
getZ
public double getZ() -
equals
-
canEqual
-
hashCode
public int hashCode()
-