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 togetherclone()
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 vectorsCalculates the cross product of two vectorsdouble
length()
Gets the length of thePathVector
@NonNull PathVector
multiply
(double value) Multiplies itself by a scalar constant@NonNull PathVector
Normalises 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 vector@NonNull PathVector
subtract
(PathVector otherVector) Subtracts one vector from another
-
Constructor Details
-
PathVector
public PathVector()
-
-
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
-