Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a 2x3 matrix for affine transformations in homogenous coordinates. This allows for translations as well as rotations, scaling, and shearing.

The six components a-f of a matrix are arranged like this:

+---+---+---+
| a | c | e |
| b | d | f |
+---+---+---+

Hierarchy

  • RaphaelMatrix

Index

Properties

a: number

The matrix component at the first row, first column.

b: number

The matrix component at the second row, first column.

c: number

The matrix component at the first row, second column.

d: number

The matrix component at the second row, second column.

e: number

The matrix component at the third row, first column.

f: number

The matrix component at the third row, second column.

Methods

  • add(a: number, b: number, c: number, d: number, e: number, f: number): void
  • Adds the given matrix to this matrix component-wise.

    The parameters a-f form a 2x3 matrix and are arranged like this.

    +---+---+---+
    | a | c | e |
    | b | d | f |
    +---+---+---+

    Parameters

    • a: number

      The matrix component at the first row, first column.

    • b: number

      The matrix component at the second row, first column.

    • c: number

      The matrix component at the first row, second column.

    • d: number

      The matrix component at the second row, second column.

    • e: number

      The matrix component at the third row, first column.

    • f: number

      The matrix component at the third row, second column.

    Returns void

  • Creates a copy of this matrix and returns it.

    Returns RaphaelMatrix

    A new matrix that is equal to this matrix.

  • Creates a new matrix that represents the inverse affine transformation of this matrix.

    Returns RaphaelMatrix

    A new matrix that represents the inverse affine transformation of this matrix.

  • rotate(a: number, x: number, y: number): void
  • Applies a rotation to this matrix.

    Parameters

    • a: number

      The angle of the rotation, in degrees.

    • x: number

      Horizontal coordinate of the origin of the rotation.

    • y: number

      Vertical coordinate of the origin of the rotation.

    Returns void

  • scale(x: number, y?: number): void
  • scale(x: number, y: number, cx: number, cy: number): void
  • Applies a scaling operation to this matrix.

    Parameters

    • x: number

      Horizontal coordinate of the origin of the scaling.

    • Optional y: number

      Vertical coordinate of the origin of the scaling. If not specified, default to same value as x.

    Returns void

  • Applies a scaling operation to this matrix.

    Parameters

    • x: number

      Horizontal coordinate of the origin of the scaling.

    • y: number

      Vertical coordinate of the origin of the scaling.

    • cx: number

      Amount by which to scale in the horizontal direction.

    • cy: number

      Amount by which to scale in the vertical direction.

    Returns void

  • Splits matrix into primitive transformations.

    Returns RaphaelMatrixTransformInfo

    Information regarding how this matrix can be produced by applying a chain of primitive transformations.

  • toTransformString(): string
  • Creates a transform string that represents given matrix, such as t0,0s1,1,0,0r0,0,0.

    Returns string

    A CSS transform string that represents given matrix.

  • translate(x: number, y: number): void
  • Applies a translation to this matrix.

    Parameters

    • x: number
    • y: number

    Returns void

  • x(x: number, y: number): number
  • Applies this transformation matrix to the given point and returns the x coordinate of that transformed point. See also y.

    Parameters

    • x: number

      Horizontal coordinate of a point to transform.

    • y: number

      Vertical coordinate of a point to transform.

    Returns number

  • y(x: number, y: number): number
  • Applies this transformation matrix to the given point and returns the y coordinate of that transformed point. See also x.

    Parameters

    • x: number

      Horizontal coordinate of a point to transform.

    • y: number

      Vertical coordinate of a point to transform.

    Returns number

Generated using TypeDoc