Package georegression.geometry
Class UtilVector3D_F64
java.lang.Object
georegression.geometry.UtilVector3D_F64
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
Returns the acute angle between the two vectors.static int
axisMaxMag
(GeoTuple3D_F64<?> v) Finds which axis in `v` has the largest magnitudestatic Vector3D_F64
convert
(org.ejml.data.DMatrixRMaj m) Converts matrices into vectors.static org.ejml.data.DMatrixRMaj
createMatrix
(@Nullable org.ejml.data.DMatrixRMaj R, Vector3D_F64... v) Creates a matrix from the set of column vectors.static Vector3D_F64
createRandom
(double min, double max, Random rand) Creates a random vector where each axis is selected from a uniform distribution.static boolean
isIdentical
(Vector3D_F64 a, Vector3D_F64 b, double 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_F64
perpendicularCanonical
(Vector3D_F64 A, @Nullable Vector3D_F64 output) Selects a vector which will be perpendicular.
-
Constructor Details
-
UtilVector3D_F64
public UtilVector3D_F64()
-
-
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_F64 perpendicularCanonical(Vector3D_F64 A, @Nullable @Nullable Vector3D_F64 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.DMatrixRMaj createMatrix(@Nullable @Nullable org.ejml.data.DMatrixRMaj R, Vector3D_F64... 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
-