doodle.geom.createMatrix
Description:
- Matrix (a:number, b:number, c:number, d:number, tx:number, ty:number) :Matrix
-
Inherits
- Object
Parameters
- a:number – [optional]
- b:number – [optional]
- c:number – [optional]
- d:number – [optional]
- tx:number – [optional]
- 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
- m:Matrix –
Returns
- Matrix –
Throws
- TypeError –
- deltaRotate (angle:number) :Matrix
-
Applies a rotation transformation to the Matrix object, ignore translation.
Parameters
- angle:number – The rotation angle in radians.
Returns
- Matrix –
Throws
- TypeError –
- rotate (angle:number) :Matrix
-
Applies a rotation transformation to the Matrix object.
Parameters
- 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
- sx:number – A multiplier used to scale the object along the x axis.
- 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
- sx:number – A multiplier used to scale the object along the x axis.
- 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
- 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
- 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
- skewX:number –
- 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
- 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
- a:number – The value that affects the positioning of pixels along the x axis when scaling or rotating an image.
- b:number – The value that affects the positioning of pixels along the y axis when rotating or skewing an image.
- c:number – The value that affects the positioning of pixels along the x axis when rotating or skewing an image.
- d:number – The value that affects the positioning of pixels along the y axis when scaling or rotating an image.
- tx:number – The distance by which to translate each point along the x axis.
- 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
- skewX:number –
- skewY:number –
Returns
- Matrix –
Throws
- TypeError –
- equals (m:Matrix) :boolean
-
Test if matrix is equal to this one.
Parameters
- m:Matrix –
Returns
- boolean –
Throws
- TypeError –
- translate (dx:number, dy:number) :Matrix
-
Translates the matrix along the x and y axes.
Parameters
- dx:number – The amount of movement along the x axis to the right, in pixels.
- 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
- m:Object –
Returns
- boolean –