Module omix.api

Class Matrix2f

java.lang.Object
omix.util.math.vector.Matrix2f

public class Matrix2f
extends Object
This class is a 2 × 2 matrix with double precision.
Author:
Dr. Peter Droste, Omix Visualization
  • Constructor Details

    • Matrix2f

      public Matrix2f()
    • Matrix2f

      public Matrix2f​(Vec2f p1, Vec2f p2)
      The matrix has the form:
      |p1.x, p2.x|
      |p1.y, p2.y|
      Parameters:
      p1 -
      p2 -
  • Method Details

    • transponate

      public Matrix2f transponate()
      Transponates the matrix.
      Returns:
      thisT
    • dot

      public Matrix2f dot​(Matrix2f matrix)
      Scalar product
      Parameters:
      matrix -
      Returns:
      this⋅matrix
    • set

      public void set​(int i, int j, float value)
      Sets the value of the matrix index (i,j).
      Parameters:
      i -
      j -
      value -
    • get

      public float get​(int i, int j)
      Returns the value of the matrix index (i,j).
      Parameters:
      i -
      j -
      Returns:
      value at i,j
    • plus

      public Matrix2f plus​(Matrix2f matrix)
      Addition
      Parameters:
      matrix -
      Returns:
      this + matrix
    • dot

      public Matrix2f dot​(float a)
      Scale
      Parameters:
      a -
      Returns:
      this⋅a
    • dot

      public Vec2f dot​(Vec2f vector)
      Product with a vector.
      Parameters:
      vector -
      Returns:
      this⋅vector
    • diag

      public Vec2f diag()
      Returns the diagonal of the matrix as vector
      Returns:
      the diagonal of the matrix as vector
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also:
      Object.toString()