Hide menu
Loading...
Searching...
No Matches
Transformation2d

Describes object transformation in 3D space.

Constructors

new Transformation2d()

new Transformation2d(rotation?, translation?, scaleFactor?): Transformation2d

Parameters

rotation?

Matrix2d

Rotation matrix of the transformation.

translation?

Vector2d

Translation vector of the transformation.

scaleFactor?

number

Scale factor.

Returns

Transformation2d

new Transformation2d()

new Transformation2d(point, angle, translation?): Transformation2d

Parameters

point

Point2d

Rotation point.

angle

number

Rotation angle.

translation?

Vector2d

Translation vector of the transformation.

Returns

Transformation2d

Properties

rotation

rotation: Matrix2d

Rotation matrix of the transformation


scaleFactor

scaleFactor: number = 1

Scale factor


translation

translation: Vector2d

Translation vector of the transformation

Methods

clone()

clone(): Transformation2d

Creates new Transformation2d object same as this.

Returns

Transformation2d


copy()

copy(other): this

Copies other transformation to this.

Parameters

other

Transformation2d

Copied object.

Returns

this


invert()

invert(): this

Inverts this transformation.

Returns

this


inverted()

inverted(): Transformation2d

Returns new Point object received by performing a invert() operation to this object.

Returns

Transformation2d


isEqual()

isEqual(other): boolean

Returns true if other transformation is equal to this transformation.

Parameters

other

Transformation2d

Other transformation.

Returns

boolean


isIdentity()

isIdentity(): boolean

Returns true if transformation is identity.

Returns

boolean


isNegative()

isNegative(): boolean

Returns true if rotation matrix determinant less than 0.

Returns

boolean


multiplied()

multiplied(other): Transformation2d

Returns new Transformation2d object received by performing a multiply() operation to this object.

Parameters

other

Transformation2d

Other transformation.

Returns

Transformation2d


multiply()

multiply(other): this

Multiplies this transformation with other.

Parameters

other

Transformation2d

Other transformation.

Returns

this


power()

power(num): this

Powers this transformation.

Parameters

num

number

Power value.

Returns

this


powered()

powered(num): Transformation2d

Returns new Transformation2d object received by performing a power() operation to this object.

Parameters

num

number

Power value.

Returns

Transformation2d


resetToIdentity()

resetToIdentity(): this

Resets this transformation to identity transformation.

Returns

this


rotationAngle()

rotationAngle(): number

Returns rotation angle in radians.

Returns

number


setRotation()

Call Signature

setRotation(matrix): this

Sets rotation matrix of transformation.

Parameters

matrix

Matrix2d

Rotation matrix.

Returns

this

Call Signature

setRotation(point, angle): this

Sets transformation as rotation around point on angle.

Parameters

point

Point2d

Rotation point.

angle

number

Rotation angle.

Returns

this


setScaleFactor()

setScaleFactor(scaleFactor): this

Sets scale factor of transformation.

Parameters

scaleFactor

number

Scale factor.

Returns

this


setTranslation()

Call Signature

setTranslation(vector): this

Sets translation vector of transformation.

Parameters

vector

Vector2d

Translation vector.

Returns

this

Call Signature

setTranslation(point1, point2): this

Sets translation vector of transformation.

Parameters

point1

Point2d

First point of translation vector.

point2

Point2d

Second point of translation vector.

Returns

this


mirrorTransformation()

Call Signature

static mirrorTransformation(point): Transformation2d

Returns new Transformation2d object that represent mirror transformation relative to the point.

Parameters

point

Point2d

Mirror point.

Returns

Transformation2d

Call Signature

static mirrorTransformation(axis): Transformation2d

Returns new Transformation2d object that represent mirror transformation relative to the axis.

Parameters

axis

Axis2d

Mirror axis.

Returns

Transformation2d


rotateTransformation()

static rotateTransformation(point, angle): Transformation2d

Returns new Transformation2d object that represent rotate transformation.

Parameters

point

Point2d

Rotation point.

angle

number

Rotation angle.

Returns

Transformation2d


scaleTransformation()

static scaleTransformation(point, scale): Transformation2d

Returns new Transformation2d object that represent scale transformation.

Parameters

point

Point2d

Point.

scale

number

Scale.

Returns

Transformation2d


translateTransformation()

static translateTransformation(vector): Transformation2d

Returns new Transformation2d object that represent translate transformation.

Parameters

vector

Vector2d

Translation vector.

Returns

Transformation2d