Class UtilVector3D_F64

java.lang.Object
georegression.geometry.UtilVector3D_F64

public class UtilVector3D_F64 extends Object
  • Constructor Details

    • UtilVector3D_F64

      public UtilVector3D_F64()
  • Method Details

    • createRandom

      public static Vector3D_F64 createRandom(double min, double max, Random rand)
      Creates a random vector where each axis is selected from a uniform distribution.
      Parameters:
      min - minimum value
      max - maximum value
      rand - 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 vector
      output - (Optional) storage for output
      Returns:
      Perpendicular vector
    • isIdentical

      public static boolean isIdentical(Vector3D_F64 a, Vector3D_F64 b, double tol)
      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

      public static void normalize(Vector3D_F64 v)
      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

      public static Vector3D_F64 convert(org.ejml.data.DMatrixRMaj m)
      Converts matrices into vectors. All matrices must be vectors with 3 elements.
      Parameters:
      m - A 3x1 or 1x3 matrix
      Returns:
      Equivalent 3D vector
    • acute

      public static double acute(GeoTuple3D_F64 a, GeoTuple3D_F64 b)
      Returns the acute angle between the two vectors. Computed using the dot product.
      Parameters:
      a - vector
      b - vector
      Returns:
      acute angle
    • axisMaxMag

      public static int axisMaxMag(GeoTuple3D_F64<?> v)
      Finds which axis in `v` has the largest magnitude