Hide menu
Loading...
Searching...
No Matches
Transformation

Describes a transformation in 3D space.

A transformation consists of a rotation matrix, a translation vector, and a scale factor.

Constructors

Constructor

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

Creates a transformation from rotation, translation, and scale components.

If all arguments are omitted, an identity transformation is created.

Parameters

rotation?

Matrix3d

Rotation matrix of the transformation.

translation?

Vector

Translation vector of the transformation.

scaleFactor?

number

Scale factor.

Returns

Transformation

Constructor

new Transformation(axis): Transformation

Creates a transformation from an axis placement.

Parameters

axis

Axis3d

Axis placement defining the transformation.

Returns

Transformation

Constructor

new Transformation(source, target): Transformation

Creates a transformation from one axis placement to another.

Parameters

source

Axis3d

Source axis placement.

target

Axis3d

Target axis placement.

Returns

Transformation

Constructor

new Transformation(vector, angle, translation?): Transformation

Creates a rotation transformation around vector by angle.

If translation is provided, it is assigned as the translation component.

Parameters

vector

Vector

Rotation vector.

angle

number

Rotation angle.

translation?

Vector

Translation vector of the transformation.

Returns

Transformation

Constructor

new Transformation(axis, angle, translation?): Transformation

Creates a rotation transformation around axis by angle.

If translation is provided, it is assigned as the translation component.

Parameters

axis

Axis1d

Rotation axis.

angle

number

Rotation angle.

translation?

Vector

Translation vector of the transformation.

Returns

Transformation

Properties

rotation

rotation: Matrix3d

Rotation matrix of the transformation.


scaleFactor

scaleFactor: number = 1

Scale factor of the transformation.


translation

translation: Vector

Translation vector of the transformation.

Methods

clone()

clone(): Transformation

Creates a new transformation with the same components as this transformation.

Returns

Transformation


copy()

copy(other): this

Copies the components of other to this transformation.

Parameters

other

Transformation

Transformation to copy.

Returns

this


invert()

invert(): this

Inverts this transformation.

Returns

this


inverted()

inverted(): Transformation

Returns a new transformation resulting from inverting this transformation.

Returns

Transformation


isEqual()

isEqual(other): boolean

Returns whether other is equal to this transformation.

Parameters

other

Transformation

Other transformation.

Returns

boolean


isIdentity()

isIdentity(): boolean

Returns whether this transformation is the identity transformation.

Returns

boolean


isNegative()

isNegative(): boolean

Returns whether the determinant of the rotation matrix is less than 0.

Returns

boolean


mirrorTransformation()

Call Signature

static mirrorTransformation(point): Transformation

Returns a mirror transformation about point.

Parameters

point

Point

Mirror point.

Returns

Transformation

Call Signature

static mirrorTransformation(axis): Transformation

Returns a mirror transformation about axis.

Parameters

axis

Axis1d

Mirror axis.

Returns

Transformation

Call Signature

static mirrorTransformation(axis): Transformation

Returns a mirror transformation about axis.

Parameters

axis

Axis3d

Mirror axis.

Returns

Transformation


multiplied()

multiplied(other): Transformation

Returns a new transformation resulting from multiplying this transformation by other.

Parameters

other

Transformation

Other transformation.

Returns

Transformation


multiply()

multiply(other): this

Multiplies this transformation by other.

Parameters

other

Transformation

Other transformation.

Returns

this


power()

power(num): this

Raises this transformation to the power num.

Parameters

num

number

Power value.

Returns

this


powered()

powered(num): Transformation

Returns a new transformation resulting from raising this transformation to the power num.

Parameters

num

number

Power value.

Returns

Transformation


resetToIdentity()

resetToIdentity(): this

Resets this transformation to the identity transformation.

Returns

this


rotateTransformation()

Call Signature

static rotateTransformation(vector, angle): Transformation

Returns a rotation transformation around vector by angle.

Parameters

vector

Vector

Rotation vector.

angle

number

Rotation angle.

Returns

Transformation

Call Signature

static rotateTransformation(axis, angle): Transformation

Returns a rotation transformation around axis by angle.

Parameters

axis

Axis1d

Rotation axis.

angle

number

Rotation angle.

Returns

Transformation


scaleTransformation()

static scaleTransformation(point, scale): Transformation

Returns a scale transformation about point.

Parameters

point

Point

Reference point of the scaling transformation.

scale

number

Scale factor.

Returns

Transformation


setRotation()

Call Signature

setRotation(matrix): this

Sets the rotation matrix of the transformation.

Parameters

matrix

Matrix3d

Rotation matrix.

Returns

this

Call Signature

setRotation(axis, angle): this

Sets the transformation as a rotation around axis by angle.

Parameters

axis

Axis1d

Rotation axis.

angle

number

Rotation angle.

Returns

this

Call Signature

setRotation(vector, angle): this

Sets the transformation as a rotation around vector by angle.

Parameters

vector

Vector

Rotation vector.

angle

number

Rotation angle.

Returns

this


setScaleFactor()

setScaleFactor(scaleFactor): this

Sets the scale factor of the transformation.

Parameters

scaleFactor

number

Scale factor.

Returns

this


setTranslation()

Call Signature

setTranslation(vector): this

Sets the translation vector of the transformation.

Parameters

vector

Vector

Translation vector.

Returns

this

Call Signature

setTranslation(point1, point2): this

Sets the translation vector of the transformation from point1 to point2.

Parameters

point1

Point

Start point of the translation vector.

point2

Point

End point of the translation vector.

Returns

this


translateTransformation()

static translateTransformation(vector): Transformation

Returns a translation transformation by vector.

Parameters

vector

Vector

Translation vector.

Returns

Transformation