1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
<title>cairo_matrix_t</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
7
<link rel="home" href="index.html" title="Cairo: A Vector Graphics Library">
8
<link rel="up" href="Support.html" title="Utilities">
9
<link rel="prev" href="Support.html" title="Utilities">
10
<link rel="next" href="cairo-Error-Handling.html" title="Error handling">
11
<meta name="generator" content="GTK-Doc V1.10 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
13
<link rel="chapter" href="Drawing.html" title="Drawing">
14
<link rel="chapter" href="Fonts.html" title="Fonts">
15
<link rel="chapter" href="Surfaces.html" title="Surfaces">
16
<link rel="chapter" href="Support.html" title="Utilities">
17
<link rel="index" href="ix01.html" title="Index">
18
<link rel="index" href="index-1.2.html" title="Index of new symbols in 1.2">
19
<link rel="index" href="index-1.4.html" title="Index of new symbols in 1.4">
20
<link rel="index" href="index-1.6.html" title="Index of new symbols in 1.6">
21
<link rel="index" href="index-1.8.html" title="Index of new symbols in 1.8">
22
<link rel="appendix" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
24
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
25
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
27
<td><a accesskey="p" href="Support.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
28
<td><a accesskey="u" href="Support.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
29
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
30
<th width="100%" align="center">Cairo: A Vector Graphics Library</th>
31
<td><a accesskey="n" href="cairo-Error-Handling.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
33
<tr><td colspan="5" class="shortcuts"><nobr><a href="#cairo-cairo-matrix-t.synopsis" class="shortcut">Top</a>
35
<a href="#cairo-cairo-matrix-t.description" class="shortcut">Description</a></nobr></td></tr>
37
<div class="refentry" lang="en">
38
<a name="cairo-cairo-matrix-t"></a><div class="titlepage"></div>
39
<div class="refnamediv"><table width="100%"><tr>
41
<h2><span class="refentrytitle"><a name="cairo-cairo-matrix-t.top_of_page"></a>cairo_matrix_t</span></h2>
42
<p>cairo_matrix_t — Generic matrix operations</p>
44
<td valign="top" align="right"></td>
46
<div class="refsynopsisdiv">
47
<a name="cairo-cairo-matrix-t.synopsis"></a><h2>Synopsis</h2>
48
<pre class="synopsis">
49
<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a>;
50
void <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-init" title="cairo_matrix_init ()">cairo_matrix_init</a> (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
57
void <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-init-identity" title="cairo_matrix_init_identity ()">cairo_matrix_init_identity</a> (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix);
58
void <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-init-translate" title="cairo_matrix_init_translate ()">cairo_matrix_init_translate</a> (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
61
void <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-init-scale" title="cairo_matrix_init_scale ()">cairo_matrix_init_scale</a> (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
64
void <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-init-rotate" title="cairo_matrix_init_rotate ()">cairo_matrix_init_rotate</a> (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
66
void <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-translate" title="cairo_matrix_translate ()">cairo_matrix_translate</a> (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
69
void <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-scale" title="cairo_matrix_scale ()">cairo_matrix_scale</a> (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
72
void <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-rotate" title="cairo_matrix_rotate ()">cairo_matrix_rotate</a> (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
74
<a class="link" href="cairo-Error-Handling.html#cairo-status-t" title="enum cairo_status_t">cairo_status_t</a> <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-invert" title="cairo_matrix_invert ()">cairo_matrix_invert</a> (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix);
75
void <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-multiply" title="cairo_matrix_multiply ()">cairo_matrix_multiply</a> (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *result,
76
const <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *a,
77
const <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *b);
78
void <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-transform-distance" title="cairo_matrix_transform_distance ()">cairo_matrix_transform_distance</a> (const <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
81
void <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-transform-point" title="cairo_matrix_transform_point ()">cairo_matrix_transform_point</a> (const <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
86
<div class="refsect1" lang="en">
87
<a name="cairo-cairo-matrix-t.description"></a><h2>Description</h2>
89
<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> is used throughout cairo to convert between different
90
coordinate spaces. A <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> holds an affine transformation,
91
such as a scale, rotation, shear, or a combination of these.
92
The transformation of a point (<code class="literal">x</code>,<code class="literal">y</code>)
95
<pre class="programlisting">
96
x_new = xx * x + xy * y + x0;
97
y_new = yx * x + yy * y + y0;
100
The current transformation matrix of a <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a>, represented as a
101
<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>, defines the transformation from user-space
102
coordinates to device-space coordinates. See <a class="link" href="cairo-Transformations.html#cairo-get-matrix" title="cairo_get_matrix ()"><code class="function">cairo_get_matrix()</code></a> and
103
<a class="link" href="cairo-Transformations.html#cairo-set-matrix" title="cairo_set_matrix ()"><code class="function">cairo_set_matrix()</code></a>.
106
<div class="refsect1" lang="en">
107
<a name="cairo-cairo-matrix-t.details"></a><h2>Details</h2>
108
<div class="refsect2" lang="en">
109
<a name="cairo-matrix-t"></a><h3>cairo_matrix_t</h3>
110
<pre class="programlisting">typedef struct {
111
double xx; double yx;
112
double xy; double yy;
113
double x0; double y0;
117
A <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> holds an affine transformation, such as a scale,
118
rotation, shear, or a combination of those. The transformation of
119
a point (x, y) is given by:
121
<pre class="programlisting">
122
x_new = xx * x + xy * y + x0;
123
y_new = yx * x + yy * y + y0;
128
<div class="variablelist"><table border="0">
129
<col align="left" valign="top">
132
<td><p><span class="term">double <em class="structfield"><code>xx</code></em>;</span></p></td>
133
<td> xx component of the affine transformation
137
<td><p><span class="term">double <em class="structfield"><code>yx</code></em>;</span></p></td>
138
<td> yx component of the affine transformation
142
<td><p><span class="term">double <em class="structfield"><code>xy</code></em>;</span></p></td>
143
<td> xy component of the affine transformation
147
<td><p><span class="term">double <em class="structfield"><code>yy</code></em>;</span></p></td>
148
<td> yy component of the affine transformation
152
<td><p><span class="term">double <em class="structfield"><code>x0</code></em>;</span></p></td>
153
<td> X translation component of the affine transformation
157
<td><p><span class="term">double <em class="structfield"><code>y0</code></em>;</span></p></td>
158
<td> Y translation component of the affine transformation
165
<div class="refsect2" lang="en">
166
<a name="cairo-matrix-init"></a><h3>cairo_matrix_init ()</h3>
167
<pre class="programlisting">void cairo_matrix_init (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
175
Sets <em class="parameter"><code>matrix</code></em> to be the affine transformation given by
176
<em class="parameter"><code>xx</code></em>, <em class="parameter"><code>yx</code></em>, <em class="parameter"><code>xy</code></em>, <em class="parameter"><code>yy</code></em>, <em class="parameter"><code>x0</code></em>, <em class="parameter"><code>y0</code></em>. The transformation is given
179
<pre class="programlisting">
180
x_new = xx * x + xy * y + x0;
181
y_new = yx * x + yy * y + y0;
186
<div class="variablelist"><table border="0">
187
<col align="left" valign="top">
190
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
191
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
195
<td><p><span class="term"><em class="parameter"><code>xx</code></em> :</span></p></td>
196
<td> xx component of the affine transformation
200
<td><p><span class="term"><em class="parameter"><code>yx</code></em> :</span></p></td>
201
<td> yx component of the affine transformation
205
<td><p><span class="term"><em class="parameter"><code>xy</code></em> :</span></p></td>
206
<td> xy component of the affine transformation
210
<td><p><span class="term"><em class="parameter"><code>yy</code></em> :</span></p></td>
211
<td> yy component of the affine transformation
215
<td><p><span class="term"><em class="parameter"><code>x0</code></em> :</span></p></td>
216
<td> X translation component of the affine transformation
220
<td><p><span class="term"><em class="parameter"><code>y0</code></em> :</span></p></td>
221
<td> Y translation component of the affine transformation
228
<div class="refsect2" lang="en">
229
<a name="cairo-matrix-init-identity"></a><h3>cairo_matrix_init_identity ()</h3>
230
<pre class="programlisting">void cairo_matrix_init_identity (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix);</pre>
232
Modifies <em class="parameter"><code>matrix</code></em> to be an identity transformation.</p>
236
<div class="variablelist"><table border="0">
237
<col align="left" valign="top">
239
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
240
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
246
<div class="refsect2" lang="en">
247
<a name="cairo-matrix-init-translate"></a><h3>cairo_matrix_init_translate ()</h3>
248
<pre class="programlisting">void cairo_matrix_init_translate (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
252
Initializes <em class="parameter"><code>matrix</code></em> to a transformation that translates by <em class="parameter"><code>tx</code></em> and
253
<em class="parameter"><code>ty</code></em> in the X and Y dimensions, respectively.</p>
257
<div class="variablelist"><table border="0">
258
<col align="left" valign="top">
261
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
262
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
266
<td><p><span class="term"><em class="parameter"><code>tx</code></em> :</span></p></td>
267
<td> amount to translate in the X direction
271
<td><p><span class="term"><em class="parameter"><code>ty</code></em> :</span></p></td>
272
<td> amount to translate in the Y direction
279
<div class="refsect2" lang="en">
280
<a name="cairo-matrix-init-scale"></a><h3>cairo_matrix_init_scale ()</h3>
281
<pre class="programlisting">void cairo_matrix_init_scale (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
285
Initializes <em class="parameter"><code>matrix</code></em> to a transformation that scales by <em class="parameter"><code>sx</code></em> and <em class="parameter"><code>sy</code></em>
286
in the X and Y dimensions, respectively.</p>
290
<div class="variablelist"><table border="0">
291
<col align="left" valign="top">
294
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
295
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
299
<td><p><span class="term"><em class="parameter"><code>sx</code></em> :</span></p></td>
300
<td> scale factor in the X direction
304
<td><p><span class="term"><em class="parameter"><code>sy</code></em> :</span></p></td>
305
<td> scale factor in the Y direction
312
<div class="refsect2" lang="en">
313
<a name="cairo-matrix-init-rotate"></a><h3>cairo_matrix_init_rotate ()</h3>
314
<pre class="programlisting">void cairo_matrix_init_rotate (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
315
double radians);</pre>
317
Initialized <em class="parameter"><code>matrix</code></em> to a transformation that rotates by <em class="parameter"><code>radians</code></em>.</p>
321
<div class="variablelist"><table border="0">
322
<col align="left" valign="top">
325
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
326
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
330
<td><p><span class="term"><em class="parameter"><code>radians</code></em> :</span></p></td>
331
<td> angle of rotation, in radians. The direction of rotation
332
is defined such that positive angles rotate in the direction from
333
the positive X axis toward the positive Y axis. With the default
334
axis orientation of cairo, positive angles rotate in a clockwise
342
<div class="refsect2" lang="en">
343
<a name="cairo-matrix-translate"></a><h3>cairo_matrix_translate ()</h3>
344
<pre class="programlisting">void cairo_matrix_translate (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
348
Applies a translation by <em class="parameter"><code>tx</code></em>, <em class="parameter"><code>ty</code></em> to the transformation in
349
<em class="parameter"><code>matrix</code></em>. The effect of the new transformation is to first translate
350
the coordinates by <em class="parameter"><code>tx</code></em> and <em class="parameter"><code>ty</code></em>, then apply the original transformation
351
to the coordinates.</p>
355
<div class="variablelist"><table border="0">
356
<col align="left" valign="top">
359
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
360
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
364
<td><p><span class="term"><em class="parameter"><code>tx</code></em> :</span></p></td>
365
<td> amount to translate in the X direction
369
<td><p><span class="term"><em class="parameter"><code>ty</code></em> :</span></p></td>
370
<td> amount to translate in the Y direction
377
<div class="refsect2" lang="en">
378
<a name="cairo-matrix-scale"></a><h3>cairo_matrix_scale ()</h3>
379
<pre class="programlisting">void cairo_matrix_scale (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
383
Applies scaling by <em class="parameter"><code>sx</code></em>, <em class="parameter"><code>sy</code></em> to the transformation in <em class="parameter"><code>matrix</code></em>. The
384
effect of the new transformation is to first scale the coordinates
385
by <em class="parameter"><code>sx</code></em> and <em class="parameter"><code>sy</code></em>, then apply the original transformation to the coordinates.</p>
389
<div class="variablelist"><table border="0">
390
<col align="left" valign="top">
393
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
394
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
398
<td><p><span class="term"><em class="parameter"><code>sx</code></em> :</span></p></td>
399
<td> scale factor in the X direction
403
<td><p><span class="term"><em class="parameter"><code>sy</code></em> :</span></p></td>
404
<td> scale factor in the Y direction
411
<div class="refsect2" lang="en">
412
<a name="cairo-matrix-rotate"></a><h3>cairo_matrix_rotate ()</h3>
413
<pre class="programlisting">void cairo_matrix_rotate (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
414
double radians);</pre>
416
Applies rotation by <em class="parameter"><code>radians</code></em> to the transformation in
417
<em class="parameter"><code>matrix</code></em>. The effect of the new transformation is to first rotate the
418
coordinates by <em class="parameter"><code>radians</code></em>, then apply the original transformation
419
to the coordinates.</p>
423
<div class="variablelist"><table border="0">
424
<col align="left" valign="top">
427
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
428
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
432
<td><p><span class="term"><em class="parameter"><code>radians</code></em> :</span></p></td>
433
<td> angle of rotation, in radians. The direction of rotation
434
is defined such that positive angles rotate in the direction from
435
the positive X axis toward the positive Y axis. With the default
436
axis orientation of cairo, positive angles rotate in a clockwise
444
<div class="refsect2" lang="en">
445
<a name="cairo-matrix-invert"></a><h3>cairo_matrix_invert ()</h3>
446
<pre class="programlisting"><a class="link" href="cairo-Error-Handling.html#cairo-status-t" title="enum cairo_status_t">cairo_status_t</a> cairo_matrix_invert (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix);</pre>
448
Changes <em class="parameter"><code>matrix</code></em> to be the inverse of it's original value. Not
449
all transformation matrices have inverses; if the matrix
450
collapses points together (it is <em class="firstterm">degenerate</em>),
451
then it has no inverse and this function will fail.</p>
455
<div class="variablelist"><table border="0">
456
<col align="left" valign="top">
459
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
460
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
464
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
465
<td> If <em class="parameter"><code>matrix</code></em> has an inverse, modifies <em class="parameter"><code>matrix</code></em> to
466
be the inverse matrix and returns <a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-SUCCESS:CAPS"><code class="literal">CAIRO_STATUS_SUCCESS</code></a>. Otherwise,
467
returns <a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-INVALID-MATRIX:CAPS"><code class="literal">CAIRO_STATUS_INVALID_MATRIX</code></a>.
474
<div class="refsect2" lang="en">
475
<a name="cairo-matrix-multiply"></a><h3>cairo_matrix_multiply ()</h3>
476
<pre class="programlisting">void cairo_matrix_multiply (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *result,
477
const <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *a,
478
const <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *b);</pre>
480
Multiplies the affine transformations in <em class="parameter"><code>a</code></em> and <em class="parameter"><code>b</code></em> together
481
and stores the result in <em class="parameter"><code>result</code></em>. The effect of the resulting
482
transformation is to first apply the transformation in <em class="parameter"><code>a</code></em> to the
483
coordinates and then apply the transformation in <em class="parameter"><code>b</code></em> to the
487
It is allowable for <em class="parameter"><code>result</code></em> to be identical to either <em class="parameter"><code>a</code></em> or <em class="parameter"><code>b</code></em>.</p>
491
<div class="variablelist"><table border="0">
492
<col align="left" valign="top">
495
<td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
496
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> in which to store the result
500
<td><p><span class="term"><em class="parameter"><code>a</code></em> :</span></p></td>
501
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
505
<td><p><span class="term"><em class="parameter"><code>b</code></em> :</span></p></td>
506
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
513
<div class="refsect2" lang="en">
514
<a name="cairo-matrix-transform-distance"></a><h3>cairo_matrix_transform_distance ()</h3>
515
<pre class="programlisting">void cairo_matrix_transform_distance (const <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
519
Transforms the distance vector (<em class="parameter"><code>dx</code></em>,<em class="parameter"><code>dy</code></em>) by <em class="parameter"><code>matrix</code></em>. This is
520
similar to <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-transform-point" title="cairo_matrix_transform_point ()"><code class="function">cairo_matrix_transform_point()</code></a> except that the translation
521
components of the transformation are ignored. The calculation of
522
the returned vector is as follows:
526
<pre class="programlisting">
527
dx2 = dx1 * a + dy1 * c;
528
dy2 = dx1 * b + dy1 * d;
533
Affine transformations are position invariant, so the same vector
534
always transforms to the same vector. If (<em class="parameter"><code>x1</code></em>,<em class="parameter"><code>y1</code></em>) transforms
535
to (<em class="parameter"><code>x2</code></em>,<em class="parameter"><code>y2</code></em>) then (<em class="parameter"><code>x1</code></em>+<em class="parameter"><code>dx1</code></em>,<em class="parameter"><code>y1</code></em>+<em class="parameter"><code>dy1</code></em>) will transform to
536
(<em class="parameter"><code>x1</code></em>+<em class="parameter"><code>dx2</code></em>,<em class="parameter"><code>y1</code></em>+<em class="parameter"><code>dy2</code></em>) for all values of <em class="parameter"><code>x1</code></em> and <em class="parameter"><code>x2</code></em>.</p>
540
<div class="variablelist"><table border="0">
541
<col align="left" valign="top">
544
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
545
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
549
<td><p><span class="term"><em class="parameter"><code>dx</code></em> :</span></p></td>
550
<td> X component of a distance vector. An in/out parameter
554
<td><p><span class="term"><em class="parameter"><code>dy</code></em> :</span></p></td>
555
<td> Y component of a distance vector. An in/out parameter
562
<div class="refsect2" lang="en">
563
<a name="cairo-matrix-transform-point"></a><h3>cairo_matrix_transform_point ()</h3>
564
<pre class="programlisting">void cairo_matrix_transform_point (const <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
568
Transforms the point (<em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em>) by <em class="parameter"><code>matrix</code></em>.</p>
572
<div class="variablelist"><table border="0">
573
<col align="left" valign="top">
576
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
577
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
581
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
582
<td> X position. An in/out parameter
586
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
587
<td> Y position. An in/out parameter
594
<div class="refsect1" lang="en">
595
<a name="cairo-cairo-matrix-t.see-also"></a><h2>See Also</h2>
598
<div class="itemizedlist"><ul type="disc"><li><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a></li></ul></div>
605
Generated by GTK-Doc V1.10</div>