Matrix2d

class Matrix2d

a Matrix2d Object.
the identity matrix and parameters position :

Constructor


new Matrix2d(args: Matrix2d | Matrix3d | number) → {}
Parameters:
Name Type Description
args Matrix2d | Matrix3d | number

an instance of me.Matrix2d or me.Matrix3d to copy from, or individual matrix components (See Matrix2d.setTransform). If not arguments are given, the matrix will be set to Identity.

Public Properties


tx matrix2.js:46
tx: number

number

tx component of the matrix

See: Matrix2d.translate
ty matrix2.js:55
ty: number

number

ty component of the matrix

See: Matrix2d.translate

Public Methods


apply matrix2.js:267
apply(v: Vector2d | Vector3d) → {Vector2d | Vector3d}

apply the current transform to the given 2d or 3d vector

Parameters:
Name Type Description
v Vector2d | Vector3d

the vector object to be transformed

Returns:
Type Description
Vector2d | Vector3d

result vector object.

applyInverse matrix2.js:288
applyInverse(v: Vector2d) → {Vector2d}

apply the inverted current transform to the given 2d vector

Parameters:
Name Type Description
v Vector2d

the vector object to be transformed

Returns:
Type Description
Vector2d

result vector object.

clone matrix2.js:449
clone() → {Matrix2d}

Clone the Matrix

Returns:
Type Description
Matrix2d
copy matrix2.js:154
copy(m: Matrix2d) → {Matrix2d}

Copies over the values from another me.Matrix2d.

Parameters:
Name Type Description
m Matrix2d

the matrix object to copy from

Returns:
Type Description
Matrix2d

Reference to this object for method chaining

equals matrix2.js:427
equals(m: Matrix2d) → {boolean}

return true if the two matrices are identical

Parameters:
Name Type Description
m Matrix2d

the other matrix

Returns:
Type Description
boolean

true if both are equals

fromMat3d matrix2.js:164
fromMat3d(m: Matrix3d) → {Matrix2d}

Copies over the upper-left 3x3 values from the given me.Matrix3d

Parameters:
Name Type Description
m Matrix3d

the matrix object to copy from

Returns:
Type Description
Matrix2d

Reference to this object for method chaining

identity matrix2.js:64
identity() → {Matrix2d}

reset the transformation matrix to the identity matrix (no transformation).
the identity matrix and parameters position :

Returns:
Type Description
Matrix2d

Reference to this object for method chaining

invert matrix2.js:235
invert() → {Matrix2d}

invert this matrix, causing it to apply the opposite transformation.

Returns:
Type Description
Matrix2d

Reference to this object for method chaining

isIdentity matrix2.js:407
isIdentity() → {boolean}

returns true if the matrix is an identity matrix.

Returns:
Type Description
boolean
multiply matrix2.js:186
multiply(m: Matrix2d) → {Matrix2d}

multiply both matrix

Parameters:
Name Type Description
m Matrix2d

the other matrix

Returns:
Type Description
Matrix2d

Reference to this object for method chaining

rotate matrix2.js:353
rotate(angle: number) → {Matrix2d}

rotate the matrix (counter-clockwise) by the specified angle (in radians).

Parameters:
Name Type Description
angle number

Rotation angle in radians.

Returns:
Type Description
Matrix2d

Reference to this object for method chaining

scale matrix2.js:306
scale(x: number, y: number) → {Matrix2d}

scale the matrix

Parameters:
Name Type Attributes Default Description
x number

a number representing the abscissa of the scaling vector.

y number

<optional>

x

a number representing the ordinate of the scaling vector.

Returns:
Type Description
Matrix2d

Reference to this object for method chaining

scaleV matrix2.js:326
scaleV(v: Vector2d) → {Matrix2d}

adds a 2D scaling transformation.

Parameters:
Name Type Description
v Vector2d

scaling vector

Returns:
Type Description
Matrix2d

Reference to this object for method chaining

scaleX matrix2.js:335
scaleX(x: number) → {Matrix2d}

specifies a 2D scale operation using the [sx, 1] scaling vector

Parameters:
Name Type Description
x number

x scaling vector

Returns:
Type Description
Matrix2d

Reference to this object for method chaining

scaleY matrix2.js:344
scaleY(y: number) → {Matrix2d}

specifies a 2D scale operation using the [1,sy] scaling vector

Parameters:
Name Type Description
y number

y scaling vector

Returns:
Type Description
Matrix2d

Reference to this object for method chaining

setTransform matrix2.js:79
setTransform(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) → {Matrix2d}

set the matrix to the specified value

Parameters:
Name Type Attributes Default Description
a number
b number
c number
d number
e number
f number
g number

<optional>

0
h number

<optional>

0
i number

<optional>

1
Returns:
Type Description
Matrix2d

Reference to this object for method chaining

toArray matrix2.js:457
toArray() → {Float32Array}

return an array representation of this Matrix

Returns:
Type Description
Float32Array
toString matrix2.js:465
toString() → {string}

convert the object to a string representation

Returns:
Type Description
string
transform matrix2.js:120
transform(a: number, b: number, c: number, d: number, e: number, f: number) → {Matrix2d}

Multiplies the current transformation with the matrix described by the arguments of this method

Parameters:
Name Type Description
a number
b number
c number
d number
e number
f number
Returns:
Type Description
Matrix2d

Reference to this object for method chaining

translate matrix2.js:381
translate(x: number | Vector2d, y: number) → {Matrix2d}

translate the matrix position on the horizontal and vertical axis

Parameters:
Name Type Attributes Description
x number | Vector2d

the x coordindates or a vector to translate the matrix by

y number

<optional>

the y coordindates to translate the matrix by

Returns:
Type Description
Matrix2d

Reference to this object for method chaining

transpose matrix2.js:215
transpose() → {Matrix2d}

Transpose the value of this matrix.

Returns:
Type Description
Matrix2d

Reference to this object for method chaining


Powered by webdoc!