java.lang.Object
imagingbook.calibration.zhang.util.Rotations

public class Rotations extends Object
This class defines methods for converting between Rodrigues rotation vectors and 3D rotation matrices, plus some related utility methods. None of these methods is currently used in other parts of the calibration library.
  • Field Details

  • Constructor Details

  • Method Details

    • toRotationMatrix

      public static double[][] toRotationMatrix(double[] rv)
      Converts a given Rodrigues rotation vector to the equivalent 3D rotation matrix. Hand-made calculation (uses no library methods).
      Parameters:
      rv - Rodrigues rotation vector
      Returns:
      the 3D rotation matrix
    • toRodriguesVector

      public static double[] toRodriguesVector(double[][] R)
      Converts a 3D rotation matrix (R) to the equivalent Rodrigues rotation vector. From "Vector Representation of Rotations", Carlo Tomasi (https://www.cs.duke.edu/courses/fall13/compsci527/notes/rodrigues.pdf). Matlab code: http://www.cs.duke.edu/courses/fall13/compsci527/notes/rodrigues.m
      Parameters:
      R - a 3D rotation matrix
      Returns:
      the Rodrigues rotation vector
    • isRotationMatrix

      public static boolean isRotationMatrix(double[][] R, double threshold)
      Checks if the specified matrix is a rotation matrix under the given orthogonality threshold.
      Parameters:
      R - the matrix to be checked
      threshold - the orthogonality threshold
      Returns:
    • isRotationMatrix

      public static boolean isRotationMatrix(double[][] R)
      Checks if the specified matrix is a rotation matrix using the default orthogonality threshold (DefaultOrthogonalityThreshold).
      Parameters:
      R - the matrix to be checked
      Returns:
    • normalizeAngle

      public static double normalizeAngle(double angle)
      Normalized the given angle to [-π,π].
      Parameters:
      angle - some angle (any finite value)
      Returns:
      the equivalent angle in [-π,π]