dojox/gfx/matrix (version 1.10)

See the dojox/gfx/matrix reference documentation for more information.

Property Summary

  • flipXa matrix, which reflects points at x = 0 line: flipX * (x, y) == (-x, y)
  • flipXYa matrix, which reflects points at the origin of coordinates: flipXY * (x, y) == (-x, -y)
  • flipYa matrix, which reflects points at y = 0 line: flipY * (x, y) == (x, -y)
  • identityan identity matrix constant: identity * (x, y) == (x, y)

Method Summary

  • _degToRad(degree)
  • _multiplyPoint(matrix,x,y) applies a matrix to a point
  • _radToDeg(radian)
  • _sandwich(matrix,x,y) applies a matrix at a central point
  • clone(matrix) creates a copy of a 2D matrix
  • invert(matrix) inverts a 2D matrix
  • isIdentity(matrix) returns whether the specified matrix is the identity.
  • Matrix2D(arg) a 2D matrix object
  • multiply(matrix) combines matrices by multiplying them sequentially in the given order
  • multiplyPoint(matrix,a,b) applies a matrix to a point
  • multiplyRectangle(matrix,rect) Applies a matrix to a rectangle.
  • normalize(matrix) converts an object to a matrix, if necessary
  • project(a,b) forms an orthogonal projection matrix
  • reflect(a,b) forms a reflection matrix
  • rotate(angle) forms a rotating matrix
  • rotateAt(angle,a,b) rotates a picture using a specified point as a center of rotation
  • rotateg(degree) forms a rotating matrix
  • rotategAt(degree,a,b) rotates a picture using a specified point as a center of rotation
  • scale(a,b) forms a scaling matrix
  • scaleAt(a,b,c,d) scales a picture using a specified point as a center of scaling
  • skewX(angle) forms an x skewing matrix
  • skewXAt(angle,a,b) skews a picture along the x axis using a specified point as a center of skewing
  • skewXg(degree) forms an x skewing matrix
  • skewXgAt(degree,a,b) skews a picture along the x axis using a specified point as a center of skewing
  • skewY(angle) forms a y skewing matrix
  • skewYAt(angle,a,b) skews a picture along the y axis using a specified point as a center of skewing
  • skewYg(degree) forms a y skewing matrix
  • skewYgAt(degree,a,b) skews a picture along the y axis using a specified point as a center of skewing
  • translate(a,b) forms a translation matrix

Properties

flipX
Defined by: dojox/gfx/matrix

a matrix, which reflects points at x = 0 line: flipX * (x, y) == (-x, y)

flipXY
Defined by: dojox/gfx/matrix

a matrix, which reflects points at the origin of coordinates: flipXY * (x, y) == (-x, -y)

flipY
Defined by: dojox/gfx/matrix

a matrix, which reflects points at y = 0 line: flipY * (x, y) == (x, -y)

identity
Defined by: dojox/gfx/matrix

an identity matrix constant: identity * (x, y) == (x, y)

Methods

_degToRad(degree)
Defined by dojox/gfx/matrix
Parameter Type Description
degree undefined
Returns:number
_multiplyPoint(matrix,x,y)
Defined by dojox/gfx/matrix

applies a matrix to a point

Parameter Type Description
matrix dojox/gfx/matrix.Matrix2D

a 2D matrix object to be applied

x Number

an x coordinate of a point

y Number

a y coordinate of a point

Returns:dojox/gfx.Point | object
_radToDeg(radian)
Defined by dojox/gfx/matrix
Parameter Type Description
radian undefined
Returns:number
_sandwich(matrix,x,y)
Defined by dojox/gfx/matrix

applies a matrix at a central point

Parameter Type Description
matrix dojox/gfx/matrix.Matrix2D

a 2D matrix-like object, which is applied at a central point

x Number

an x component of the central point

y Number

a y component of the central point

Returns:undefined
clone(matrix)
Defined by dojox/gfx/matrix

creates a copy of a 2D matrix

Parameter Type Description
matrix dojox/gfx/matrix.Matrix2D

a 2D matrix-like object to be cloned

Returns:dojox/gfx/matrix.Matrix2D | instance
invert(matrix)
Defined by dojox/gfx/matrix

inverts a 2D matrix

Parameter Type Description
matrix dojox/gfx/matrix.Matrix2D

a 2D matrix-like object to be inverted

Returns:dojox/gfx/matrix.Matrix2D | instance
isIdentity(matrix)
Defined by dojox/gfx/matrix

returns whether the specified matrix is the identity.

Parameter Type Description
matrix dojox/gfx/matrix.Matrix2D

a 2D matrix object to be tested

Returns:Boolean | boolean
Matrix2D(arg)
Defined by dojox/gfx/matrix

a 2D matrix object

Normalizes a 2D matrix-like object. If arrays is passed, all objects of the array are normalized and multiplied sequentially.

Parameter Type Description
arg Object

a 2D matrix-like object, a number, or an array of such objects

multiply(matrix)
Defined by dojox/gfx/matrix

combines matrices by multiplying them sequentially in the given order

Parameter Type Description
matrix dojox/gfx/matrix.Matrix2D

a 2D matrix-like object, all subsequent arguments are matrix-like objects too

Returns:instance
multiplyPoint(matrix,a,b)
Defined by dojox/gfx/matrix

applies a matrix to a point

Parameter Type Description
matrix dojox/gfx/matrix.Matrix2D

a 2D matrix object to be applied

a Number | dojox/gfx.Point

an x coordinate of a point, or a point

b Number
Optional

a y coordinate of a point

Returns:dojox/gfx.Point | undefined
multiplyRectangle(matrix,rect)
Defined by dojox/gfx/matrix

Applies a matrix to a rectangle.

The method applies the transformation on all corners of the rectangle and returns the smallest rectangle enclosing the 4 transformed points.

Parameter Type Description
matrix dojox/gfx/matrix.Matrix2D

a 2D matrix object to be applied.

rect Rectangle

the rectangle to transform.

Returns:dojox/gfx.Rectangle | object | dojo/gfx.Rectangle
normalize(matrix)
Defined by dojox/gfx/matrix

converts an object to a matrix, if necessary

Converts any 2D matrix-like object or an array of such objects to a valid dojox/gfx/matrix.Matrix2D object.

Parameter Type Description
matrix Object

an object, which is converted to a matrix, if necessary

Returns:dojox/gfx/matrix.Matrix2D | instance
project(a,b)
Defined by dojox/gfx/matrix

forms an orthogonal projection matrix

The resulting matrix is used to project points orthogonally on a vector, which goes through the origin.

Parameter Type Description
a dojox/gfx.Point | Number

a point-like object, which specifies a vector of projection, or an x coordinate value

b Number
Optional

a y coordinate value

Returns:dojox/gfx/matrix.Matrix2D | instance
reflect(a,b)
Defined by dojox/gfx/matrix

forms a reflection matrix

The resulting matrix is used to reflect points around a vector, which goes through the origin.

Parameter Type Description
a dojox/gfx.Point | Number

a point-like object, which specifies a vector of reflection, or an X value

b Number
Optional

a Y value

Returns:dojox/gfx/matrix.Matrix2D | instance
rotate(angle)
Defined by dojox/gfx/matrix

forms a rotating matrix

The resulting matrix is used to rotate points around the origin of coordinates (0, 0) by specified angle.

Parameter Type Description
angle Number

an angle of rotation in radians (>0 for CW)

Returns:dojox/gfx/matrix.Matrix2D | instance
rotateAt(angle,a,b)
Defined by dojox/gfx/matrix

rotates a picture using a specified point as a center of rotation

Parameter Type Description
angle Number

an angle of rotation in radians (>0 for CW)

a Number | dojox/gfx.Point

an x component of a central point, or a central point

b Number
Optional

a y component of a central point

Returns:dojox/gfx/matrix.Matrix2D | undefined
rotateg(degree)
Defined by dojox/gfx/matrix

forms a rotating matrix

The resulting matrix is used to rotate points around the origin of coordinates (0, 0) by specified degree. See dojox/gfx/matrix.rotate() for comparison.

Parameter Type Description
degree Number

an angle of rotation in degrees (>0 for CW)

Returns:dojox/gfx/matrix.Matrix2D | undefined
rotategAt(degree,a,b)
Defined by dojox/gfx/matrix

rotates a picture using a specified point as a center of rotation

Parameter Type Description
degree Number

an angle of rotation in degrees (>0 for CW)

a Number | dojox/gfx.Point

an x component of a central point, or a central point

b Number
Optional

a y component of a central point

Returns:dojox/gfx/matrix.Matrix2D | undefined
scale(a,b)
Defined by dojox/gfx/matrix

forms a scaling matrix

The resulting matrix is used to scale (magnify) points by specified offsets.

Parameter Type Description
a Number | dojox/gfx.Point

a scaling factor used for the x coordinate, or a uniform scaling factor used for the both coordinates, or a point-like object, which specifies scale factors for both dimensions

b Number
Optional

a scaling factor used for the y coordinate

Returns:dojox/gfx/matrix.Matrix2D | instance
scaleAt(a,b,c,d)
Defined by dojox/gfx/matrix

scales a picture using a specified point as a center of scaling

Parameter Type Description
a Number

a scaling factor used for the x coordinate, or a uniform scaling factor used for both coordinates

b Number
Optional

a scaling factor used for the y coordinate

c Number | Point

an x component of a central point, or a central point

d Number

a y component of a central point

Returns:dojox/gfx/matrix.Matrix2D | undefined
skewX(angle)
Defined by dojox/gfx/matrix

forms an x skewing matrix

The resulting matrix is used to skew points in the x dimension around the origin of coordinates (0, 0) by specified angle.

Parameter Type Description
angle Number

a skewing angle in radians

Returns:dojox/gfx/matrix.Matrix2D | instance
skewXAt(angle,a,b)
Defined by dojox/gfx/matrix

skews a picture along the x axis using a specified point as a center of skewing

Parameter Type Description
angle Number

a skewing angle in radians

a Number | dojox/gfx.Point

an x component of a central point, or a central point

b Number
Optional

a y component of a central point

Returns:dojox/gfx/matrix.Matrix2D | undefined
skewXg(degree)
Defined by dojox/gfx/matrix

forms an x skewing matrix

The resulting matrix is used to skew points in the x dimension around the origin of coordinates (0, 0) by specified degree. See dojox/gfx/matrix.skewX() for comparison.

Parameter Type Description
degree Number

a skewing angle in degrees

Returns:dojox/gfx/matrix.Matrix2D | undefined
skewXgAt(degree,a,b)
Defined by dojox/gfx/matrix

skews a picture along the x axis using a specified point as a center of skewing

Parameter Type Description
degree Number

a skewing angle in degrees

a Number | dojox/gfx.Point

an x component of a central point, or a central point

b Number
Optional

a y component of a central point

Returns:dojox/gfx/matrix.Matrix2D | undefined
skewY(angle)
Defined by dojox/gfx/matrix

forms a y skewing matrix

The resulting matrix is used to skew points in the y dimension around the origin of coordinates (0, 0) by specified angle.

Parameter Type Description
angle Number

a skewing angle in radians

Returns:dojox/gfx/matrix.Matrix2D | instance
skewYAt(angle,a,b)
Defined by dojox/gfx/matrix

skews a picture along the y axis using a specified point as a center of skewing

Parameter Type Description
angle Number

a skewing angle in radians

a Number | dojox/gfx.Point

an x component of a central point, or a central point

b Number
Optional

a y component of a central point

Returns:dojox/gfx/matrix.Matrix2D | undefined
skewYg(degree)
Defined by dojox/gfx/matrix

forms a y skewing matrix

The resulting matrix is used to skew points in the y dimension around the origin of coordinates (0, 0) by specified degree. See dojox/gfx/matrix.skewY() for comparison.

Parameter Type Description
degree Number

a skewing angle in degrees

Returns:dojox/gfx/matrix.Matrix2D | undefined
skewYgAt(degree,a,b)
Defined by dojox/gfx/matrix

skews a picture along the y axis using a specified point as a center of skewing

Parameter Type Description
degree Number

a skewing angle in degrees

a Number | dojox/gfx.Point

an x component of a central point, or a central point

b Number
Optional

a y component of a central point

Returns:dojox/gfx/matrix.Matrix2D | undefined
translate(a,b)
Defined by dojox/gfx/matrix

forms a translation matrix

The resulting matrix is used to translate (move) points by specified offsets.

Parameter Type Description
a Number | dojox/gfx.Point

an x coordinate value, or a point-like object, which specifies offsets for both dimensions

b Number
Optional

a y coordinate value

Returns:dojox/gfx/matrix.Matrix2D | instance
Error in the documentation? Can’t find what you are looking for? Let us know!