Class Matrix

Hierarchy

  • Matrix

Methods

  • Sets Matrix to:

     | scaleX  skewX transX |
    | skewY scaleY transY |
    | pers0 pers1 pers2 |

    Returns

    Matrix constructed from parameters

    Parameters

    • scaleX: number

      horizontal scale factor

    • skewX: number

      horizontal skew factor

    • transX: number

      horizontal translation

    • skewY: number

      vertical skew factor

    • scaleY: number

      vertical scale factor

    • transY: number

      vertical translation

    • pers0: number = 0

      input x-axis perspective factor

    • pers1: number = 0

      input y-axis perspective factor

    • pers2: number = 1

      perspective scale factor

    Returns Matrix

  • Sets Matrix to scale by (sx, sy). Returned matrix is:

      | sx  0  0 |
    | 0 sy 0 |
    | 0 0 1 |

    Returns

    Matrix with scale

    Parameters

    • scaleX: number

      horizontal scale factor

    • Optional scaleY: number

      [optionals] vertical scale factor, default equal scaleX.

    Returns Matrix

  • Sets Matrix to translate by (dx, dy). Returned matrix is:

      | 1 0 dx |
    | 0 1 dy |
    | 0 0 1 |

    Returns

    Matrix with translation

    Parameters

    • dx: number

      horizontal translation

    • dy: number

      vertical translation

    Returns Matrix

  • Sets all values from parameters. Sets matrix to:

     | scaleX  skewX transX |
    | skewY scaleY transY |
    | persp0 persp1 persp2 |

    Parameters

    • scaleX: number

      horizontal scale factor to store

    • skewX: number

      horizontal skew factor to store

    • transX: number

      horizontal translation to store

    • skewY: number

      vertical skew factor to store

    • scaleY: number

      vertical scale factor to store

    • transY: number

      vertical translation to store

    Returns void

  • Parameters

    • a: number
    • b: number
    • c: number
    • d: number
    • tx: number
    • ty: number

    Returns void

  • Sets Matrix to identity; which has no effect on mapped Point. Sets Matrix to:

      | 1 0 0 |
    | 0 1 0 |
    | 0 0 1 |

    Also called setIdentity(); use the one that provides better inline documentation.

    Returns void

  • Sets Matrix to translate by (dx, dy).

    Parameters

    • dx: number

      horizontal translation

    • dy: number

      vertical translation

    Returns void

  • Sets Matrix to scale by sx and sy, about a pivot point at (px, py). The pivot point is unchanged when mapped with Matrix.

    Parameters

    • sx: number

      horizontal scale factor

    • sy: number

      vertical scale factor

    • px: number = 0

      pivot on x-axis

    • py: number = 0

      pivot on y-axis

    Returns void

  • Sets Matrix to rotate by degrees about a pivot point at (px, py). The pivot point is unchanged when mapped with Matrix. Positive degrees rotates clockwise.

    Parameters

    • degrees: number

      angle of axes relative to upright axes

    • px: number = 0

      pivot on x-axis

    • py: number = 0

      pivot on y-axis

    Returns void

  • Sets Matrix to rotate by sinValue and cosValue, about a pivot point at (px, py). The pivot point is unchanged when mapped with Matrix. Vector (sinValue, cosValue) describes the angle of rotation relative to (0, 1). Vector length specifies scale.

    Parameters

    • sinV: number
    • cosV: number
    • px: number = 0
    • py: number = 0

    Returns void

  • Sets Matrix to skew by kx and ky, about a pivot point at (px, py). The pivot point is unchanged when mapped with Matrix.

    Parameters

    • kx: number

      horizontal skew factor

    • ky: number

      vertical skew factor

    • px: number = 0

      pivot on x-axis

    • py: number = 0

      pivot on y-axis

    Returns void

  • Sets Matrix to Matrix a multiplied by Matrix b. Either a or b may be this.

    Given:

         | A B C |      | J K L |
    a = | D E F |, b = | M N O |
    | G H I | | P Q R |

    sets Matrix to:

             | A B C |   | J K L |   | AJ+BM+CP AK+BN+CQ AL+BO+CR |
    a * b = | D E F | * | M N O | = | DJ+EM+FP DK+EN+FQ DL+EO+FR |
    | G H I | | P Q R | | GJ+HM+IP GK+HN+IQ GL+HO+IR |

    Parameters

    • a: Matrix

      Matrix on left side of multiply expression

    • b: Matrix

      Matrix on right side of multiply expression

    Returns void

  • Preconcats the matrix with the specified scale. M' = M * S(sx, sy)

    Parameters

    • dx: number
    • dy: number

    Returns void

  • Postconcats the matrix with the specified scale. M' = S(sx, sy, px, py) * M

    Parameters

    • sx: number
    • sy: number
    • px: number = 0
    • py: number = 0

    Returns void

  • Preconcats the matrix with the specified rotation. M' = M * R(degrees, px, py)

    Parameters

    • degrees: number
    • px: number = 0
    • py: number = 0

    Returns void

  • Preconcats the matrix with the specified skew. M' = M * K(kx, ky, px, py)

    Parameters

    • kx: number
    • ky: number
    • px: number = 0
    • py: number = 0

    Returns void

  • Postconcats the matrix with the specified translation. M' = T(dx, dy) * M

    Parameters

    • dx: number
    • dy: number

    Returns void

  • Postconcats the matrix with the specified scale. M' = S(sx, sy, px, py) * M

    Parameters

    • sx: number
    • sy: number
    • px: number = 0
    • py: number = 0

    Returns void

  • Postconcats the matrix with the specified rotation. M' = R(degrees, px, py) * M

    Parameters

    • degrees: number
    • px: number = 0
    • py: number = 0

    Returns void

  • Postconcats the matrix with the specified skew. M' = K(kx, ky, px, py) * M

    Parameters

    • kx: number
    • ky: number
    • px: number = 0
    • py: number = 0

    Returns void

Constructors

Properties

wasmIns: any
isDestroyed: boolean = false

Accessors

Generated using TypeDoc