.. include:: headings.inc .. currentmodule:: lib.graphics .. highlight:: python .. _lib.graphics.GraphicsMatrix: ========================================================================================================================================== |phoenix_title| **GraphicsMatrix** ========================================================================================================================================== A matrix holds an affine transformations, such as a scale, rotation, shear, or a combination of these, and is used to convert between different coordinante spaces. | |class_hierarchy| Inheritance Diagram ===================================== Inheritance diagram for class **GraphicsMatrix** .. raw:: html

Inheritance diagram of GraphicsMatrix

| |super_classes| Known Superclasses ================================== :class:`lib.graphics.GraphicsObject` | |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~lib.graphics.GraphicsMatrix.__init__` :meth:`~lib.graphics.GraphicsMatrix.Clone` :meth:`~lib.graphics.GraphicsMatrix.Concat` Concatenates the matrix passed with the current matrix. :meth:`~lib.graphics.GraphicsMatrix.Get` Return the component values of the matrix as a tuple. :meth:`~lib.graphics.GraphicsMatrix.GetNativeMatrix` :meth:`~lib.graphics.GraphicsMatrix.Invert` Inverts the matrix. :meth:`~lib.graphics.GraphicsMatrix.IsEqual` Returns ``True`` if the elements of the transformation matricies are equal. :meth:`~lib.graphics.GraphicsMatrix.IsIdentity` Returns ``True`` if this is the identity matrix. :meth:`~lib.graphics.GraphicsMatrix.Rotate` Rotates the matrix in radians :meth:`~lib.graphics.GraphicsMatrix.Scale` Scale the matrix :meth:`~lib.graphics.GraphicsMatrix.Set` Set the componenets of the matrix by value, default values :meth:`~lib.graphics.GraphicsMatrix.TransformDistance` Applies this matrix to a distance (ie. performs all transforms :meth:`~lib.graphics.GraphicsMatrix.TransformPoint` Applies this matrix to a point and returns the result :meth:`~lib.graphics.GraphicsMatrix.Translate` Translate the metrix. This shifts the origin. ================================================================================ ================================================================================ | |api| Class API =============== .. class:: GraphicsMatrix(GraphicsObject) A matrix holds an affine transformations, such as a scale, rotation, shear, or a combination of these, and is used to convert between different coordinante spaces. .. method:: __init__(self) .. method:: Clone(self) .. method:: Concat(self, matrix) Concatenates the matrix passed with the current matrix. .. method:: Get(self) Return the component values of the matrix as a tuple. .. method:: GetNativeMatrix(self) .. method:: Invert(self) Inverts the matrix. .. method:: IsEqual(self, matrix) Returns ``True`` if the elements of the transformation matricies are equal. .. method:: IsIdentity() Returns ``True`` if this is the identity matrix. .. method:: Rotate(self, angle) Rotates the matrix in radians .. method:: Scale(self, xScale, yScale) Scale the matrix .. method:: Set(self, a=1.0, b=0.0, c=0.0, d=1.0, tx=0.0, ty=0.0) Set the componenets of the matrix by value, default values are the identity matrix. .. method:: TransformDistance(self, dx, dy) Applies this matrix to a distance (ie. performs all transforms except translations.) .. method:: TransformPoint(self, x, y) Applies this matrix to a point and returns the result .. method:: Translate(self, dx, dy) Translate the metrix. This shifts the origin.