<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>cairomm: Cairo::Matrix Class Reference</title> <link href="cairomm.css" rel="stylesheet" type="text/css"> </head> <body> <!-- Generated by Doxygen 1.7.1 --> <div class="navigation" id="top"> <div class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> </ul> </div> <div class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"> <ul> <li><a class="el" href="namespaceCairo.html">Cairo</a> </li> <li><a class="el" href="classCairo_1_1Matrix.html">Cairo::Matrix</a> </li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="#related">Related Functions</a> </div> <div class="headertitle"> <h1>Cairo::Matrix Class Reference</h1> </div> </div> <div class="contents"> <!-- doxytag: class="Cairo::Matrix" --><!-- doxytag: inherits="cairo_matrix_t" --> <p>A Transformation matrix. <a href="#_details">More...</a></p> <p>Inherits <a class="el" href="classcairo__matrix__t.html">cairo_matrix_t</a>.</p> <p><a href="classCairo_1_1Matrix-members.html">List of all members.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Matrix.html#a69297a4b8adc2bdecece4c372edc1e63">Matrix</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Creates an uninitialized matrix. <a href="#a69297a4b8adc2bdecece4c372edc1e63"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Matrix.html#a90a6fe36d7744bfd607c2b37435ca8e6">Matrix</a> (double xx, double yx, double xy, double yy, double x0, double y0)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a matrix Sets to be the affine transformation given by xx, yx, xy, yy, x0, y0. <a href="#a90a6fe36d7744bfd607c2b37435ca8e6"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Matrix.html#aec65d01b5251144dc20708f0b05940f6">translate</a> (double tx, double ty)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Applies a translation by tx, ty to the transformation in matrix. <a href="#aec65d01b5251144dc20708f0b05940f6"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Matrix.html#a697c488fb323f4a6edda4edd0533c95c">scale</a> (double sx, double sy)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Applies scaling by sx, sy to the transformation in matrix. <a href="#a697c488fb323f4a6edda4edd0533c95c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Matrix.html#a98b3feae5ff15937c764ebec846efb33">rotate</a> (double radians)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Applies rotation by radians to the transformation in matrix. <a href="#a98b3feae5ff15937c764ebec846efb33"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Matrix.html#a3ad532fa3b90ac4019d6a535ffde0cd4">invert</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Changes matrix to be the inverse of it's original value. <a href="#a3ad532fa3b90ac4019d6a535ffde0cd4"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Matrix.html#a748df1dafe6a35422fa51b31f6932587">multiply</a> (<a class="el" href="classCairo_1_1Matrix.html">Matrix</a>& a, <a class="el" href="classCairo_1_1Matrix.html">Matrix</a>& b)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Multiplies the affine transformations in a and b together and stores the result in this matrix. <a href="#a748df1dafe6a35422fa51b31f6932587"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Matrix.html#a7966181b002249878a895bb3911f39e8">transform_distance</a> (double& dx, double& dy) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Transforms the distance vector (dx,dy) by matrix. <a href="#a7966181b002249878a895bb3911f39e8"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Matrix.html#af0b0ac8dd645036fdd4a3ee54cdcaca6">transform_point</a> (double& x, double& y) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Transforms the point (x, y) by this matrix. <a href="#af0b0ac8dd645036fdd4a3ee54cdcaca6"></a><br/></td></tr> <tr><td colspan="2"><h2><a name="related"></a> Related Functions</h2></td></tr> <tr><td colspan="2"><p>(Note that these are not member functions.) </p> <br/><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classCairo_1_1Matrix.html">Matrix</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Matrix.html#a293cbaf13eb86244648cb558b2cf7dd3">identity_matrix</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns a <a class="el" href="classCairo_1_1Matrix.html" title="A Transformation matrix.">Matrix</a> initialized to the identity matrix. <a href="#a293cbaf13eb86244648cb558b2cf7dd3"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classCairo_1_1Matrix.html">Matrix</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Matrix.html#ae638d4c68c7f26f9760335eb42680cea">translation_matrix</a> (double tx, double ty)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns a <a class="el" href="classCairo_1_1Matrix.html" title="A Transformation matrix.">Matrix</a> initialized to a transformation that translates by tx and ty in the X and Y dimensions, respectively. <a href="#ae638d4c68c7f26f9760335eb42680cea"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classCairo_1_1Matrix.html">Matrix</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Matrix.html#ac217befdf043bdb5f1c29632e60cbdef">scaling_matrix</a> (double sx, double sy)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns a <a class="el" href="classCairo_1_1Matrix.html" title="A Transformation matrix.">Matrix</a> initialized to a transformation that scales by sx and sy in the X and Y dimensions, respectively. <a href="#ac217befdf043bdb5f1c29632e60cbdef"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classCairo_1_1Matrix.html">Matrix</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Matrix.html#a324cadc45a2fe7424cb0d0d6b73ccbe8">rotation_matrix</a> (double radians)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns a <a class="el" href="classCairo_1_1Matrix.html" title="A Transformation matrix.">Matrix</a> initialized to a transformation that rotates by radians. <a href="#a324cadc45a2fe7424cb0d0d6b73ccbe8"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classCairo_1_1Matrix.html">Matrix</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1Matrix.html#ab0bbb2ec9c1451f42f0270652df8cada">operator*</a> (const <a class="el" href="classCairo_1_1Matrix.html">Matrix</a>& a, const <a class="el" href="classCairo_1_1Matrix.html">Matrix</a>& b)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Multiplies the affine transformations in a and b together and returns the result. <a href="#ab0bbb2ec9c1451f42f0270652df8cada"></a><br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>A Transformation matrix. </p> <p><a class="el" href="classCairo_1_1Matrix.html" title="A Transformation matrix.">Cairo::Matrix</a> is used throughout cairomm to convert between different coordinate spaces. A <a class="el" href="classCairo_1_1Matrix.html" title="A Transformation matrix.">Matrix</a> holds an affine transformation, such as a scale, rotation, shear, or a combination of these. The transformation of a point (x,y) is given by:</p> <div class="fragment"><pre class="fragment"> x_new = xx * x + xy * y + x0; y_new = yx * x + yy * y + y0; </pre></div><p>The current transformation matrix of a <a class="el" href="classCairo_1_1Context.html" title="Context is the main class used to draw in cairomm.">Context</a>, represented as a <a class="el" href="classCairo_1_1Matrix.html" title="A Transformation matrix.">Matrix</a>, defines the transformation from user-space coordinates to device-space coordinates. </p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classCairo_1_1Context.html#a03b21f4a3a44e28086c3a25075fdcea1" title="Stores the current transformation matrix (CTM) into matrix.">Context::get_matrix()</a> </dd> <dd> <a class="el" href="classCairo_1_1Context.html#ac2eafbac5591e569d22495f7920d60d2" title="Modifies the current transformation matrix (CTM) by setting it equal to matrix.">Context::set_matrix()</a> </dd></dl> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="a69297a4b8adc2bdecece4c372edc1e63"></a><!-- doxytag: member="Cairo::Matrix::Matrix" ref="a69297a4b8adc2bdecece4c372edc1e63" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Cairo::Matrix::Matrix </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Creates an uninitialized matrix. </p> <p>If you want a matrix initialized to a certain value, either specify the values explicitly with the other constructor or use one of the free functions for initializing matrices with specific scales, rotations, etc.</p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classCairo_1_1Matrix.html#a293cbaf13eb86244648cb558b2cf7dd3" title="Returns a Matrix initialized to the identity matrix.">identity_matrix()</a> </dd> <dd> <a class="el" href="classCairo_1_1Matrix.html#a324cadc45a2fe7424cb0d0d6b73ccbe8" title="Returns a Matrix initialized to a transformation that rotates by radians.">rotation_matrix()</a> </dd> <dd> <a class="el" href="classCairo_1_1Matrix.html#ae638d4c68c7f26f9760335eb42680cea" title="Returns a Matrix initialized to a transformation that translates by tx and ty in the X and Y dimensio...">translation_matrix()</a> </dd> <dd> <a class="el" href="classCairo_1_1Matrix.html#ac217befdf043bdb5f1c29632e60cbdef" title="Returns a Matrix initialized to a transformation that scales by sx and sy in the X and Y dimensions...">scaling_matrix()</a> </dd></dl> </div> </div> <a class="anchor" id="a90a6fe36d7744bfd607c2b37435ca8e6"></a><!-- doxytag: member="Cairo::Matrix::Matrix" ref="a90a6fe36d7744bfd607c2b37435ca8e6" args="(double xx, double yx, double xy, double yy, double x0, double y0)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Cairo::Matrix::Matrix </td> <td>(</td> <td class="paramtype">double </td> <td class="paramname"> <em>xx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double </td> <td class="paramname"> <em>yx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double </td> <td class="paramname"> <em>xy</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double </td> <td class="paramname"> <em>yy</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double </td> <td class="paramname"> <em>x0</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double </td> <td class="paramname"> <em>y0</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Creates a matrix Sets to be the affine transformation given by xx, yx, xy, yy, x0, y0. </p> <p>The transformation is given by:</p> <div class="fragment"><pre class="fragment"> x_new = xx * x + xy * y + x0; y_new = yx * x + yy * y + y0; </pre></div><dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>xx</em> </td><td>xx component of the affine transformation </td></tr> <tr><td valign="top"></td><td valign="top"><em>yx</em> </td><td>yx component of the affine transformation </td></tr> <tr><td valign="top"></td><td valign="top"><em>xy</em> </td><td>xy component of the affine transformation </td></tr> <tr><td valign="top"></td><td valign="top"><em>yy</em> </td><td>yy component of the affine transformation </td></tr> <tr><td valign="top"></td><td valign="top"><em>x0</em> </td><td>X translation component of the affine transformation </td></tr> <tr><td valign="top"></td><td valign="top"><em>y0</em> </td><td>Y translation component of the affine transformation </td></tr> </table> </dd> </dl> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a3ad532fa3b90ac4019d6a535ffde0cd4"></a><!-- doxytag: member="Cairo::Matrix::invert" ref="a3ad532fa3b90ac4019d6a535ffde0cd4" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Cairo::Matrix::invert </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Changes matrix to be the inverse of it's original value. </p> <p>Not all transformation matrices have inverses; if the matrix collapses points together (it is degenerate), then it has no inverse and this function will throw an exception. </p> </div> </div> <a class="anchor" id="a748df1dafe6a35422fa51b31f6932587"></a><!-- doxytag: member="Cairo::Matrix::multiply" ref="a748df1dafe6a35422fa51b31f6932587" args="(Matrix &a, Matrix &b)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Cairo::Matrix::multiply </td> <td>(</td> <td class="paramtype"><a class="el" href="classCairo_1_1Matrix.html">Matrix</a>& </td> <td class="paramname"> <em>a</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classCairo_1_1Matrix.html">Matrix</a>& </td> <td class="paramname"> <em>b</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Multiplies the affine transformations in a and b together and stores the result in this matrix. </p> <p>The effect of the resulting transformation is to first apply the transformation in a to the coordinates and then apply the transformation in b to the coordinates.</p> <p>It is allowable for result to be identical to either a or b.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>a</em> </td><td>a <a class="el" href="classCairo_1_1Matrix.html" title="A Transformation matrix.">Matrix</a> </td></tr> <tr><td valign="top"></td><td valign="top"><em>b</em> </td><td>a <a class="el" href="classCairo_1_1Matrix.html" title="A Transformation matrix.">Matrix</a></td></tr> </table> </dd> </dl> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classCairo_1_1Matrix.html#ab0bbb2ec9c1451f42f0270652df8cada" title="Multiplies the affine transformations in a and b together and returns the result.">operator*()</a> </dd></dl> </div> </div> <a class="anchor" id="a98b3feae5ff15937c764ebec846efb33"></a><!-- doxytag: member="Cairo::Matrix::rotate" ref="a98b3feae5ff15937c764ebec846efb33" args="(double radians)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Cairo::Matrix::rotate </td> <td>(</td> <td class="paramtype">double </td> <td class="paramname"> <em>radians</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Applies rotation by radians to the transformation in matrix. </p> <p>The effect of the new transformation is to first rotate the coordinates by radians, then apply the original transformation to the coordinates.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>radians</em> </td><td>angle of rotation, in radians. The direction of rotation is defined such that positive angles rotate in the direction from the positive X axis toward the positive Y axis. With the default axis orientation of cairo, positive angles rotate in a clockwise direction. </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a697c488fb323f4a6edda4edd0533c95c"></a><!-- doxytag: member="Cairo::Matrix::scale" ref="a697c488fb323f4a6edda4edd0533c95c" args="(double sx, double sy)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Cairo::Matrix::scale </td> <td>(</td> <td class="paramtype">double </td> <td class="paramname"> <em>sx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double </td> <td class="paramname"> <em>sy</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Applies scaling by sx, sy to the transformation in matrix. </p> <p>The effect of the new transformation is to first scale the coordinates by sx and sy, then apply the original transformation to the coordinates.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>sx</em> </td><td>scale factor in the X direction </td></tr> <tr><td valign="top"></td><td valign="top"><em>sy</em> </td><td>scale factor in the Y direction </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a7966181b002249878a895bb3911f39e8"></a><!-- doxytag: member="Cairo::Matrix::transform_distance" ref="a7966181b002249878a895bb3911f39e8" args="(double &dx, double &dy) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Cairo::Matrix::transform_distance </td> <td>(</td> <td class="paramtype">double & </td> <td class="paramname"> <em>dx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double & </td> <td class="paramname"> <em>dy</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Transforms the distance vector (dx,dy) by matrix. </p> <p>This is similar to <a class="el" href="classCairo_1_1Matrix.html#af0b0ac8dd645036fdd4a3ee54cdcaca6" title="Transforms the point (x, y) by this matrix.">transform_point()</a> except that the translation components of the transformation are ignored. The calculation of the returned vector is as follows:</p> <div class="fragment"><pre class="fragment"> dx2 = dx1 * a + dy1 * c; dy2 = dx1 * b + dy1 * d; </pre></div><p>Affine transformations are position invariant, so the same vector always transforms to the same vector. If (x1,y1) transforms to (x2,y2) then (x1+dx1,y1+dy1) will transform to (x1+dx2,y1+dy2) for all values of x1 and x2.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>dx</em> </td><td>X component of a distance vector. An in/out parameter </td></tr> <tr><td valign="top"></td><td valign="top"><em>dy</em> </td><td>Y component of a distance vector. An in/out parameter </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="af0b0ac8dd645036fdd4a3ee54cdcaca6"></a><!-- doxytag: member="Cairo::Matrix::transform_point" ref="af0b0ac8dd645036fdd4a3ee54cdcaca6" args="(double &x, double &y) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Cairo::Matrix::transform_point </td> <td>(</td> <td class="paramtype">double & </td> <td class="paramname"> <em>x</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double & </td> <td class="paramname"> <em>y</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Transforms the point (x, y) by this matrix. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>x</em> </td><td>X position. An in/out parameter </td></tr> <tr><td valign="top"></td><td valign="top"><em>y</em> </td><td>Y position. An in/out parameter </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="aec65d01b5251144dc20708f0b05940f6"></a><!-- doxytag: member="Cairo::Matrix::translate" ref="aec65d01b5251144dc20708f0b05940f6" args="(double tx, double ty)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Cairo::Matrix::translate </td> <td>(</td> <td class="paramtype">double </td> <td class="paramname"> <em>tx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double </td> <td class="paramname"> <em>ty</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Applies a translation by tx, ty to the transformation in matrix. </p> <p>The effect of the new transformation is to first translate the coordinates by tx and ty, then apply the original transformation to the coordinates.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>tx</em> </td><td>amount to translate in the X direction </td></tr> <tr><td valign="top"></td><td valign="top"><em>ty</em> </td><td>amount to translate in the Y direction </td></tr> </table> </dd> </dl> </div> </div> <hr/><h2>Friends And Related Function Documentation</h2> <a class="anchor" id="a293cbaf13eb86244648cb558b2cf7dd3"></a><!-- doxytag: member="Cairo::Matrix::identity_matrix" ref="a293cbaf13eb86244648cb558b2cf7dd3" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classCairo_1_1Matrix.html">Matrix</a> identity_matrix </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td><code> [related]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Returns a <a class="el" href="classCairo_1_1Matrix.html" title="A Transformation matrix.">Matrix</a> initialized to the identity matrix. </p> </div> </div> <a class="anchor" id="ab0bbb2ec9c1451f42f0270652df8cada"></a><!-- doxytag: member="Cairo::Matrix::operator*" ref="ab0bbb2ec9c1451f42f0270652df8cada" args="(const Matrix &a, const Matrix &b)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classCairo_1_1Matrix.html">Matrix</a> operator* </td> <td>(</td> <td class="paramtype">const <a class="el" href="classCairo_1_1Matrix.html">Matrix</a>& </td> <td class="paramname"> <em>a</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classCairo_1_1Matrix.html">Matrix</a>& </td> <td class="paramname"> <em>b</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [related]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Multiplies the affine transformations in a and b together and returns the result. </p> <p>The effect of the resulting transformation is to first apply the transformation in a to the coordinates and then apply the transformation in b to the coordinates.</p> <p>It is allowable for result to be identical to either a or b.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>a</em> </td><td>a <a class="el" href="classCairo_1_1Matrix.html" title="A Transformation matrix.">Matrix</a> </td></tr> <tr><td valign="top"></td><td valign="top"><em>b</em> </td><td>a <a class="el" href="classCairo_1_1Matrix.html" title="A Transformation matrix.">Matrix</a> </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a324cadc45a2fe7424cb0d0d6b73ccbe8"></a><!-- doxytag: member="Cairo::Matrix::rotation_matrix" ref="a324cadc45a2fe7424cb0d0d6b73ccbe8" args="(double radians)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classCairo_1_1Matrix.html">Matrix</a> rotation_matrix </td> <td>(</td> <td class="paramtype">double </td> <td class="paramname"> <em>radians</em></td> <td> ) </td> <td><code> [related]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Returns a <a class="el" href="classCairo_1_1Matrix.html" title="A Transformation matrix.">Matrix</a> initialized to a transformation that rotates by radians. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>radians</em> </td><td>angle of rotation, in radians. The direction of rotation is defined such that positive angles rotate in the direction from the positive X axis toward the positive Y axis. With the default axis orientation of cairo, positive angles rotate in a clockwise direction. </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="ac217befdf043bdb5f1c29632e60cbdef"></a><!-- doxytag: member="Cairo::Matrix::scaling_matrix" ref="ac217befdf043bdb5f1c29632e60cbdef" args="(double sx, double sy)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classCairo_1_1Matrix.html">Matrix</a> scaling_matrix </td> <td>(</td> <td class="paramtype">double </td> <td class="paramname"> <em>sx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double </td> <td class="paramname"> <em>sy</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [related]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Returns a <a class="el" href="classCairo_1_1Matrix.html" title="A Transformation matrix.">Matrix</a> initialized to a transformation that scales by sx and sy in the X and Y dimensions, respectively. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>sx</em> </td><td>scale factor in the X direction </td></tr> <tr><td valign="top"></td><td valign="top"><em>sy</em> </td><td>scale factor in the Y direction </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="ae638d4c68c7f26f9760335eb42680cea"></a><!-- doxytag: member="Cairo::Matrix::translation_matrix" ref="ae638d4c68c7f26f9760335eb42680cea" args="(double tx, double ty)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classCairo_1_1Matrix.html">Matrix</a> translation_matrix </td> <td>(</td> <td class="paramtype">double </td> <td class="paramname"> <em>tx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double </td> <td class="paramname"> <em>ty</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [related]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Returns a <a class="el" href="classCairo_1_1Matrix.html" title="A Transformation matrix.">Matrix</a> initialized to a transformation that translates by tx and ty in the X and Y dimensions, respectively. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>tx</em> </td><td>amount to translate in the X direction </td></tr> <tr><td valign="top"></td><td valign="top"><em>ty</em> </td><td>amount to translate in the Y direction </td></tr> </table> </dd> </dl> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li>cairomm/matrix.h</li> </ul> </div> <hr class="footer"/><address class="footer"><small>Generated on Thu Dec 30 2010 22:31:50 for cairomm by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address> </body> </html>