Describes a transformation in 2D space.
A transformation consists of a rotation matrix, a translation vector, and a scale factor.
new Transformation2d(
rotation?,translation?,scaleFactor?):Transformation2d
Creates a transformation from rotation, translation, and scale components.
If all arguments are omitted, an identity transformation is created.
Rotation matrix of the transformation.
Translation vector of the transformation.
number
Scale factor.
Transformation2d
new Transformation2d(
point,angle,translation?):Transformation2d
Creates a rotation transformation around point by angle.
If translation is provided, it is assigned as the translation component.
Rotation point.
number
Rotation angle.
Translation vector of the transformation.
Transformation2d
rotation:
Matrix2d
Rotation matrix of the transformation.
scaleFactor:
number=1
Scale factor of the transformation.
translation:
Vector2d
Translation vector of the transformation.
clone():
Transformation2d
Creates a new transformation with the same components as this transformation.
Transformation2d
copy(
other):this
Copies the components of other to this transformation.
Transformation2d
Transformation to copy.
this
invert():
this
Inverts this transformation.
this
inverted():
Transformation2d
Returns a new transformation resulting from inverting this transformation.
Transformation2d
isEqual(
other):boolean
Returns whether other is equal to this transformation.
Transformation2d
Other transformation.
boolean
isIdentity():
boolean
Returns whether this transformation is the identity transformation.
boolean
isNegative():
boolean
Returns whether the determinant of the rotation matrix is less than 0.
boolean
staticmirrorTransformation(point):Transformation2d
Returns a mirror transformation about point.
Mirror point.
Transformation2d
staticmirrorTransformation(axis):Transformation2d
Returns a mirror transformation about axis.
Mirror axis.
Transformation2d
multiplied(
other):Transformation2d
Returns a new transformation resulting from multiplying this transformation by other.
Transformation2d
Other transformation.
Transformation2d
multiply(
other):this
Multiplies this transformation by other.
Transformation2d
Other transformation.
this
power(
num):this
Raises this transformation to the power num.
number
Power value.
this
powered(
num):Transformation2d
Returns a new transformation resulting from raising this transformation to the power num.
number
Power value.
Transformation2d
resetToIdentity():
this
Resets this transformation to the identity transformation.
this
staticrotateTransformation(point,angle):Transformation2d
Returns a rotation transformation around point by angle.
Rotation point.
number
Rotation angle.
Transformation2d
rotationAngle():
number
Returns the rotation angle in radians.
number
staticscaleTransformation(point,scale):Transformation2d
Returns a scale transformation about point.
Reference point of the scaling transformation.
number
Scale factor.
Transformation2d
setRotation(
matrix):this
Sets the rotation matrix of the transformation.
Rotation matrix.
this
setRotation(
point,angle):this
Sets the transformation as a rotation around point by angle.
Rotation point.
number
Rotation angle.
this
setScaleFactor(
scaleFactor):this
Sets the scale factor of the transformation.
number
Scale factor.
this
setTranslation(
vector):this
Sets the translation vector of the transformation.
Translation vector.
this
setTranslation(
point1,point2):this
Sets the translation vector of the transformation from point1 to point2.
Start point of the translation vector.
End point of the translation vector.
this
statictranslateTransformation(vector):Transformation2d
Returns a translation transformation by vector.
Translation vector.
Transformation2d