Contents
Class Vector
java.lang.Object
cnuphys.adaptiveSwim.geometry.Point
cnuphys.adaptiveSwim.geometry.Vector
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic double
angleBetween
(Vector a, Vector b) Compute the angle between two vectors in radiansstatic double
angleBetweenDeg
(Vector a, Vector b) Compute the angle between two vectors in degreesstatic Vector
The cross product of two vectorsstatic void
The in-place cross product of two vectorsstatic Vector
difference
(Vector a, Vector b) Get the difference between two vectorsstatic void
difference
(Vector a, Vector b, Vector c) Get the in-place difference between two vectorsdouble
length()
The length of the vectordouble
The square of the length of the vectorstatic Vector
project vector a in the direction of vector bvoid
scale
(double scaleFactor) Scale a vectorvoid
set
(double x, double y, double z) Set the components of the vectorGet a unit vector in the same direction as thisMethods inherited from class cnuphys.adaptiveSwim.geometry.Point
difference, difference, distance, distance, dot, dot, toString
-
Constructor Details
-
Method Details
-
lengthSquared
public double lengthSquared()The square of the length of the vector- Returns:
- the square of the length of the vector
-
length
public double length()The length of the vector- Returns:
- the length of the vector
-
set
-
cross
-
cross
-
scale
public void scale(double scaleFactor) Scale a vector- Parameters:
scaleFactor
- the scale factor
-
angleBetween
-
angleBetweenDeg
-
unitVector
-
project
-
difference
-
difference
-