Package ej.microvg

## Class Matrix

- java.lang.Object
- - ej.microvg.Matrix

-     public class Matrix
      extends Object

  Represents a 3x3 matrix for transforming coordinates.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Matrix()` | Creates an identity matrix.
    `Matrix​(Matrix source)` | Creates a matrix that is a deep copy of the given matrix.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `postConcat​(Matrix other)` | Postconcats the matrix with the specified matrix.
    `void` | `postRotate​(float degrees)` | Postconcats the matrix with the specified rotation.
    `void` | `postScale​(float sx, float sy)` | Postconcats the matrix with the specified scale.
    `void` | `postTranslate​(float dx, float dy)` | Postconcats the matrix with the specified translation.
    `void` | `preConcat​(Matrix other)` | Preconcats the matrix with the specified matrix.
    `void` | `preRotate​(float degrees)` | Preconcats the matrix with the specified rotation.
    `void` | `preScale​(float sx, float sy)` | Preconcats the matrix with the specified scale.
    `void` | `preTranslate​(float dx, float dy)` | Preconcats the matrix with the specified translation.
    `void` | `reset()` | Resets the matrix to identity.
    `void` | `set​(Matrix source)` | Deep copies the given matrix into this matrix.
    `void` | `setConcat​(Matrix a, Matrix b)` | Sets the matrix to the concatenation of the two specified matrices.
    `void` | `setRotate​(float degrees)` | Sets the matrix to rotate about (0,0) by the specified number of degrees.
    `void` | `setScale​(float sx, float sy)` | Sets the matrix to scale by (sx, sy).
    `void` | `setTranslate​(float dx, float dy)` | Sets the matrix to translate by (dx, dy).

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Matrix

          public Matrix()

      Creates an identity matrix.

    - #### Matrix

          public Matrix​(Matrix source)

      Creates a matrix that is a deep copy of the given matrix.
      Parameters:
        `source` - the matrix to copy from

  - ### Method Detail

    - #### set

          public void set​(Matrix source)

      Deep copies the given matrix into this matrix.
      Parameters:
        `source` - the matrix to copy from

    - #### reset

          public void reset()

      Resets the matrix to identity.

    - #### setTranslate

          public void setTranslate​(float dx,
                                   float dy)

      Sets the matrix to translate by (dx, dy).
      Parameters:
        `dx` - the translation on x
        `dy` - the translation on y

    - #### setScale

          public void setScale​(float sx,
                               float sy)

      Sets the matrix to scale by (sx, sy).
      Parameters:
        `sx` - the scale on x
        `sy` - the scale on y

    - #### setRotate

          public void setRotate​(float degrees)

      Sets the matrix to rotate about (0,0) by the specified number of degrees.
      Parameters:
        `degrees` - the degrees to rotate

    - #### setConcat

          public void setConcat​(Matrix a,
                                Matrix b)

      Sets the matrix to the concatenation of the two specified matrices.

      Either of the two matrices may also be the target matrix, that is `matrixA.setConcat(matrixA, matrixB);` is valid.

      Parameters:
        `a` - the first matrix
        `b` - the second matrix

    - #### preTranslate

          public void preTranslate​(float dx,
                                   float dy)

      Preconcats the matrix with the specified translation. M' = M * T(dx, dy)
      Parameters:
        `dx` - the translation on x
        `dy` - the translation on y

    - #### preScale

          public void preScale​(float sx,
                               float sy)

      Preconcats the matrix with the specified scale. M' = M * S(sx, sy)
      Parameters:
        `sx` - the scale on x
        `sy` - the scale on y

    - #### preRotate

          public void preRotate​(float degrees)

      Preconcats the matrix with the specified rotation. M' = M * R(degrees)
      Parameters:
        `degrees` - the degrees to rotate

    - #### preConcat

          public void preConcat​(Matrix other)

      Preconcats the matrix with the specified matrix. M' = M * other
      Parameters:
        `other` - the matrix to concat with

    - #### postTranslate

          public void postTranslate​(float dx,
                                    float dy)

      Postconcats the matrix with the specified translation. M' = T(dx, dy) * M
      Parameters:
        `dx` - the translation on x
        `dy` - the translation on y

    - #### postScale

          public void postScale​(float sx,
                                float sy)

      Postconcats the matrix with the specified scale. M' = S(sx, sy) * M
      Parameters:
        `sx` - the scale on x
        `sy` - the scale on y

    - #### postRotate

          public void postRotate​(float degrees)

      Postconcats the matrix with the specified rotation. M' = R(degrees) * M
      Parameters:
        `degrees` - the degrees to rotate

    - #### postConcat

          public void postConcat​(Matrix other)

      Postconcats the matrix with the specified matrix. M' = other * M
      Parameters:
        `other` - the matrix to concat with