doodle.geom.createMatrix

Description:

Matrix (a:number, b:number, c:number, d:number, tx:number, ty:number) :Matrix

Inherits

  1. Object

Parameters

  1. a:number – [optional]
  2. b:number – [optional]
  3. c:number – [optional]
  4. d:number – [optional]
  5. tx:number – [optional]
  6. ty:number – [optional]

Returns

  • Matrix –

Throws

  • TypeError –
  • SyntaxError –

Properties

rotation :number

Return the angle of rotation in radians.

Returns

  • number – radians

Throws

  • TypeError –
tx :number

The distance by which to translate each point along the x axis.

Returns

  • number –

Throws

  • TypeError –
ty :number

The distance by which to translate each point along the y axis.

Returns

  • number –

Throws

  • TypeError –
c :number

The value that affects the positioning of pixels along the x axis when rotating or skewing an image.

Returns

  • number –

Throws

  • TypeError –
a :number

The value that affects the positioning of pixels along the x axis when scaling or rotating an image.

Returns

  • number –

Throws

  • TypeError –
b :number

The value that affects the positioning of pixels along the y axis when rotating or skewing an image.

Returns

  • number –

Throws

  • TypeError –
d :number

The value that affects the positioning of pixels along the y axis when scaling or rotating an image.

Returns

  • number –

Throws

  • TypeError –

Methods

add (m:Matrix) :Matrix

Add a matrix with the current matrix.

Parameters

  1. m:Matrix –

Returns

  • Matrix –

Throws

  • TypeError –
deltaRotate (angle:number) :Matrix

Applies a rotation transformation to the Matrix object, ignore translation.

Parameters

  1. angle:number – The rotation angle in radians.

Returns

  • Matrix –

Throws

  • TypeError –
rotate (angle:number) :Matrix

Applies a rotation transformation to the Matrix object.

Parameters

  1. angle:number – The rotation angle in radians.

Returns

  • Matrix –

Throws

  • TypeError –
deltaScale (sx:number, sy:number) :Matrix

Applies a scaling transformation to the matrix, ignores translation.

Parameters

  1. sx:number – A multiplier used to scale the object along the x axis.
  2. sy:number – A multiplier used to scale the object along the y axis.

Returns

  • Matrix –

Throws

  • TypeError –
scale (sx:number, sy:number) :Matrix

Applies a scaling transformation to the matrix.

Parameters

  1. sx:number – A multiplier used to scale the object along the x axis.
  2. sy:number – A multiplier used to scale the object along the y axis.

Returns

  • Matrix –

Throws

  • TypeError –
deltaTransformPoint (pt:Point) :Point

Given a point in the pretransform coordinate space, returns the coordinates of that point after the transformation occurs. Unlike 'transformPoint', does not consider translation.

Parameters

  1. pt:Point –

Returns

  • Point –

Throws

  • TypeError –
multiply (m:Matrix) :Matrix

Multiplies a matrix with the current matrix, effectively combining the geometric effects of the two.

Parameters

  1. m:Matrix – The matrix to be concatenated to the source matrix.

Returns

  • Matrix –

Throws

  • TypeError –
id () :string

Returns

  • string –
matchInternalPointWithExternal () :void

Throws

  • TypeError –
rotateAroundExternalPoint () :void

Throws

  • TypeError –
rotateAroundInternalPoint () :void

Throws

  • TypeError –
skew (skewX:number, skewY:number) :Matrix

Parameters

  1. skewX:number –
  2. skewY:number –

Returns

  • Matrix –

Throws

  • TypeError –
invert () :Matrix

Performs the opposite transformation of the original matrix.

Returns

  • Matrix –
toArray () :Array

Returns an array value containing the properties of the Matrix object.

Returns

  • Array –
clone () :Matrix

Returns a new Matrix object that is a clone of this matrix, with an exact copy of the contained object.

Returns

  • Matrix –
toString () :string

Returns a text value listing the properties of the Matrix object.

Returns

  • string –
transformPoint (pt:Point) :Point

Returns the result of applying the geometric transformation represented by the Matrix object to the specified point.

Parameters

  1. pt:Point –

Returns

  • Point –

Throws

  • TypeError –
identity () :Matrix

Sets each matrix property to a value that causes a null transformation.

Returns

  • Matrix –
compose (a:number, b:number, c:number, d:number, tx:number, ty:number) :Matrix

Set values of this matrix with the specified parameters.

Parameters

  1. a:number – The value that affects the positioning of pixels along the x axis when scaling or rotating an image.
  2. b:number – The value that affects the positioning of pixels along the y axis when rotating or skewing an image.
  3. c:number – The value that affects the positioning of pixels along the x axis when rotating or skewing an image.
  4. d:number – The value that affects the positioning of pixels along the y axis when scaling or rotating an image.
  5. tx:number – The distance by which to translate each point along the x axis.
  6. ty:number – The distance by which to translate each point along the y axis.

Returns

  • Matrix –

Throws

  • TypeError –
deltaSkew (skewX:number, skewY:number) :Matrix

Skew matrix and ignore translation.

Parameters

  1. skewX:number –
  2. skewY:number –

Returns

  • Matrix –

Throws

  • TypeError –
equals (m:Matrix) :boolean

Test if matrix is equal to this one.

Parameters

  1. m:Matrix –

Returns

  • boolean –

Throws

  • TypeError –
translate (dx:number, dy:number) :Matrix

Translates the matrix along the x and y axes.

Parameters

  1. dx:number – The amount of movement along the x axis to the right, in pixels.
  2. dy:number – The amount of movement down along the y axis, in pixels.

Returns

  • Matrix –

Throws

  • TypeError –
interpolate () :Matrix

Update matrix 'in-between' this and another matrix given a value of t bewteen 0 and 1.

Returns

  • Matrix –

Throws

  • TypeError –

Class Functions

isMatrix (m:Object) :boolean

Check if a given object contains a numeric matrix properties. Does not check if a matrix is actually a doodle.geom.matrix.

Parameters

  1. m:Object –

Returns

  • boolean –