User Guide
432 Working with Geometry
The translate() method
The translate() method simply applies the dx and dy translation factors by calling the
translate() method of the matrix object, as follows:
sourceMatrix.translate(dx, dy);
return sourceMatrix;
The rotate() method
The rotate() method converts the input rotation factor to radians (if it is provided in
degrees or gradients), and then calls the
rotate() method of the matrix object:
if (unit == "degrees")
{
angle = Math.PI * 2 * angle / 360;
}
if (unit == "gradients")
{
angle = Math.PI * 2 * angle / 100;
}
sourceMatrix.rotate(angle);
return sourceMatrix;
Calling the MatrixTransformer.transform() method
from the application
The application contains a user interface for getting the transformation parameters from the
user. It then passes these, along with the
matrix property of the transform property of the
display object, to the
Matrix.transform() method, as follows:
tempMatrix = MatrixTransformer.transform(tempMatrix,
xScaleSlider.value,
yScaleSlider.value,
dxSlider.value,
dySlider.value,
rotationSlider.value,
skewSlider.value,
skewSide );
The application then applies the return value to the matrix property of the transform
property of the display object, thereby triggering the transformation:
img.content.transform.matrix = tempMatrix;