Class R3x3

All Implemented Interfaces:
Serializable, IArchive

public class R3x3 extends SquareMatrix<R3x3> implements Serializable

Represents an element of R3×3, the set of real, 3×3 matrices. The class also contains the usual set of matrix operations and linear transforms on R3 induced by the matrix.

Author:
Christopher Allen
See Also:
  • Field Details

    • INT_SIZE

      public static final int INT_SIZE
      number of dimensions (DIM=3)
      See Also:
  • Constructor Details

    • R3x3

      public R3x3()
      Creates a new instance of R3x3 initialized to zero.
    • R3x3

      public R3x3(R3x3 matInit)
      Copy Constructor - create a deep copy of the target matrix.
      Parameters:
      matInit - initial value
    • R3x3

      public R3x3(double[][] arrValues) throws ArrayIndexOutOfBoundsException
      Initializing constructor for class R3x3. The values of the new matrix are set to the given Java primitive type array (the array itself is unchanged). The dimensions of the argument must be 3×3.
      Parameters:
      arrValues - initial values for the new matrix object
      Throws:
      ArrayIndexOutOfBoundsException - the argument must have the dimensions 3×3
      Since:
      Oct 4, 2013
    • R3x3

      public R3x3(String strTokens) throws IllegalArgumentException, NumberFormatException
      Parsing Constructor - create a R3x3 instance and initialize it according to a token string of element values. The token string argument is assumed to be one-dimensional and packed by column (ala FORTRAN).
      Parameters:
      strTokens - token vector of 3x3=9 numeric values
      Throws:
      IllegalArgumentException - wrong number of token strings
      NumberFormatException - bad number format, unparseable
  • Method Details

    • newZero

      public static R3x3 newZero()
      Create a new instance of a zero matrix.
      Returns:
      matrix whose elements are all zero
    • newIdentity

      public static R3x3 newIdentity()
      Create a new instance of the identity matrix
      Returns:
      identity matrix object
    • newRotationX

      public static R3x3 newRotationX(double dblAng)
      Create and return the generator element of SO(3) which is a counter-clockwise rotation about the x axis.
      Parameters:
      dblAng - angle in radians
      Returns:
      x-plane counter-clockwise rotation matrix
    • newRotationY

      public static R3x3 newRotationY(double dblAng)
      Create and return the generator element of SO(3) which is a counter-clockwise rotation about the y axis.
      Parameters:
      dblAng - angle in radians
      Returns:
      y-plane counter-clockwise rotation matrix
    • newRotationZ

      public static R3x3 newRotationZ(double dblAng)
      Create and return the generator element of SO(3) which is a counter-clockwise rotation about the z axis.
      Parameters:
      dblAng - angle in radians
      Returns:
      z-plane counter-clockwise rotation matrix
    • copy

      public static R3x3 copy(R3x3 matTarget)
      Create a deep copy of the given R3x3 matrix object. The returned object is completely decoupled from the original.
      Parameters:
      matTarget - matrix to be copied
      Returns:
      a deep copy of the argument object
    • parse

      public static R3x3 parse(String strTokens) throws IllegalArgumentException, NumberFormatException
      Create a R3x3 instance and initialize it according to a token string of element values. The token string argument is assumed to be one-dimensional and packed by column (ala FORTRAN).
      Parameters:
      strTokens - token vector of 3x3=9 numeric values
      Throws:
      IllegalArgumentException - wrong number of token strings
      NumberFormatException - bad number format, unparseable
    • clone

      public R3x3 clone()
      Creates and returns a deep copy of this matrix.
      Specified by:
      clone in class BaseMatrix<R3x3>
      Since:
      Jul 3, 2014
      See Also:
    • setElem

      public void setElem(R3x3.POS pos, double val)
      Set the element specified by the position in the argument to the new value in the second argument.
      Parameters:
      pos - matrix position
      val - new element value
    • getElem

      public double getElem(R3x3.POS pos)
      Return matrix element value. Get matrix element value at specified position.
    • times

      public R3 times(R3 vec)
      Nondestructive Matrix-Vector multiplication.
      Returns:
      this*vec
    • newInstance

      protected R3x3 newInstance(int row, int cnt)
      Handles object creation required by the base class.
      Specified by:
      newInstance in class BaseMatrix<R3x3>
      Parameters:
      row - Number of rows.
      cnt - Number of columns.
      Returns:
      uninitialized matrix object of type M
      Since:
      Jun 17, 2014
      See Also:
      • xal.tools.math.BaseMatrix#newInstance()