Package georegression.geometry
Class UtilVector3D_F32
java.lang.Object
georegression.geometry.UtilVector3D_F32
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic float
Returns the acute angle between the two vectors.static int
axisMaxMag
(GeoTuple3D_F32<?> v) Finds which axis in `v` has the largest magnitudestatic Vector3D_F32
convert
(org.ejml.data.FMatrixRMaj m) Converts matrices into vectors.static org.ejml.data.FMatrixRMaj
createMatrix
(@Nullable org.ejml.data.FMatrixRMaj R, Vector3D_F32... v) Creates a matrix from the set of column vectors.static Vector3D_F32
createRandom
(float min, float max, Random rand) Creates a random vector where each axis is selected from a uniform distribution.static boolean
isIdentical
(Vector3D_F32 a, Vector3D_F32 b, float tol) Checks to see if the two vectors are identical to within tolerance.static void
Rescales the vector such that its normal is equal to one.static Vector3D_F32
perpendicularCanonical
(Vector3D_F32 A, @Nullable Vector3D_F32 output) Selects a vector which will be perpendicular.
-
Constructor Details
-
UtilVector3D_F32
public UtilVector3D_F32()
-
-
Method Details
-
createRandom
Creates a random vector where each axis is selected from a uniform distribution.- Parameters:
min
- minimum valuemax
- maximum valuerand
- random number generator- Returns:
- the new random vector
-
perpendicularCanonical
public static Vector3D_F32 perpendicularCanonical(Vector3D_F32 A, @Nullable @Nullable Vector3D_F32 output) Selects a vector which will be perpendicular.- Parameters:
A
- (Input) A vectoroutput
- (Optional) storage for output- Returns:
- Perpendicular vector
-
isIdentical
Checks to see if the two vectors are identical to within tolerance. Each axis is checked individually.- Parameters:
a
- First vector.b
- Second vector.tol
- Tolerance for equality.- Returns:
- true if identical and false if not.
-
normalize
Rescales the vector such that its normal is equal to one.- Parameters:
v
- Vector being normalized.
-
createMatrix
public static org.ejml.data.FMatrixRMaj createMatrix(@Nullable @Nullable org.ejml.data.FMatrixRMaj R, Vector3D_F32... v) Creates a matrix from the set of column vectors. Each vector is a column in the new matrix.- Parameters:
v
- Set of vectors. Not modified.R
- If not null the vectors are stored here.- Returns:
- Matrix.
-
convert
Converts matrices into vectors. All matrices must be vectors with 3 elements.- Parameters:
m
- A 3x1 or 1x3 matrix- Returns:
- Equivalent 3D vector
-
acute
Returns the acute angle between the two vectors. Computed using the dot product.- Parameters:
a
- vectorb
- vector- Returns:
- acute angle
-
axisMaxMag
Finds which axis in `v` has the largest magnitude
-