Class Matrix3d

java.lang.Object
org.eclipse.mosaic.lib.math.Matrix3d
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
RotationMatrix

public class Matrix3d extends Object implements Serializable
See Also:
  • Field Details

  • Constructor Details

    • Matrix3d

      public Matrix3d()
      Creates a new 3x3 matrix, with all values being zero.
    • Matrix3d

      public Matrix3d(Matrix3d copyFrom)
      Creates a new 3x3 matrix, with the values being copied from the given matrix.
  • Method Details

    • identityMatrix

      public static Matrix3d identityMatrix()
      Creates a new identity matrix in 3x3 format.
    • setIdentity

      public Matrix3d setIdentity()
      Sets all values to match identity matrix.
    • setZero

      public Matrix3d setZero()
      Sets all values to zero.
    • set

      public Matrix3d set(Matrix3d m)
      Copies the values from the given matrix to this matrix.
    • set

      public Matrix3d set(double[] values, MatrixElementOrder inputOrder)
      Sets the values of the matrix by the given double array. The order parameter defines how the values in the given array are arranged (either column or row-wise).
    • set

      public Matrix3d set(float[] values, MatrixElementOrder inputOrder)
      Sets the values of the matrix by the given float array. The order parameter defines how the values in the given array are arranged (either column or row-wise).
    • getAsDoubleArray

      public double[] getAsDoubleArray(double[] result, MatrixElementOrder outputOrder)
      Returns the values of the matrix and writes it into the the given double array. The order parameter defines how the values in the given array will be arranged (either column or row-wise).
    • getAsFloatArray

      public float[] getAsFloatArray(float[] result, MatrixElementOrder outputOrder)
      Returns the values of the matrix and writes it into the the given float array. The order parameter defines how the values in the given array will be arranged (either column or row-wise).
    • get

      public double get(int row, int col)
      Get a specific value from the matrix by row and column index
    • set

      public Matrix3d set(int row, int col, double value)
      Sets a specific value in the matrix by row and column index
    • add

      public Matrix3d add(Matrix3d mat)
      Adds a matrix to this matrix.
    • add

      public Matrix3d add(Matrix3d mat, Matrix3d result)
      Adds a matrix to this matrix and writes the result into the result matrix.
    • subtract

      public Matrix3d subtract(Matrix3d mat)
      Subtracts a matrix from this matrix.
    • subtract

      public Matrix3d subtract(Matrix3d mat, Matrix3d result)
      Subtracts a matrix from this matrix and writes the result into the result matrix.
    • multiply

      public Matrix3d multiply(Matrix3d mat, Matrix3d result)
      Multiplies this matrix with another matrix and writes the result into the result matrix.
    • multiply

      public Vector3d multiply(Vector3d v)
      Multiplies this matrix with a 3-dimensional vector.
    • multiply

      public Vector3d multiply(Vector3d v, Vector3d result)
      Multiplies this matrix with a 3-dimensional vector and writes the result into the given vector.
    • transpose

      public Matrix3d transpose()
      Transposes this matrix.
    • transpose

      public Matrix3d transpose(Matrix3d result)
      Writes a transposed version of this matrix into the result matrix.
    • invert

      public boolean invert()
      Inverts this matrix.
      Returns:
      true, if the inverse could be created.
    • inverse

      public boolean inverse(Matrix3d result)
      Writes a inverted version of this matrix into the result matrix.
      Returns:
      true, if the inverse could be created.
    • copy

      public Matrix3d copy()
      Creates copy of this matrix.
    • isFuzzyEqual

      public boolean isFuzzyEqual(Matrix3d other)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object