update dev300-m58
[ooovba.git] / offapi / com / sun / star / geometry / AffineMatrix2D.idl
blobff7ff30615be1a8e46d8d8a8c65bb946b4622d50
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: AffineMatrix2D.idl,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef __com_sun_star_geometry_AffineMatrix2D_idl__
31 #define __com_sun_star_geometry_AffineMatrix2D_idl__
33 module com { module sun { module star { module geometry {
35 /** This structure defines a 2 by 3 affine matrix.<p>
37 The matrix defined by this structure constitutes an affine mapping
38 of a point in 2D to another point in 2D. The last line of a
39 complete 3 by 3 matrix is omitted, since it is implicitely assumed
40 to be [0,0,1].<p>
42 An affine mapping, as performed by this matrix, can be written out
43 as follows, where <code>xs</code> and <code>ys</code> are the source, and
44 <code>xd</code> and <code>yd</code> the corresponding result coordinates:
46 <code>
47 xd = m00*xs + m01*ys + m02;
48 yd = m10*xs + m11*ys + m12;
49 </code><p>
51 Thus, in common matrix language, with M being the
52 <type>AffineMatrix2D</type> and vs=[xs,ys]^T, vd=[xd,yd]^T two 2D
53 vectors, the affine transformation is written as
54 vd=M*vs. Concatenation of transformations amounts to
55 multiplication of matrices, i.e. a translation, given by T,
56 followed by a rotation, given by R, is expressed as vd=R*(T*vs) in
57 the above notation. Since matrix multiplication is associative,
58 this can be shortened to vd=(R*T)*vs=M'*vs. Therefore, a set of
59 consecutive transformations can be accumulated into a single
60 AffineMatrix2D, by multiplying the current transformation with the
61 additional transformation from the left.<p>
63 Due to this transformational approach, all geometry data types are
64 points in abstract integer or real coordinate spaces, without any
65 physical dimensions attached to them. This physical measurement
66 units are typically only added when using these data types to
67 render something onto a physical output device, like a screen or a
68 printer, Then, the total transformation matrix and the device
69 resolution determine the actual measurement unit.<p>
71 @since OOo 2.0.0
73 struct AffineMatrix2D
75 /// The top, left matrix entry.
76 double m00;
78 /// The top, middle matrix entry.
79 double m01;
81 /// The top, right matrix entry.
82 double m02;
84 /// The bottom, left matrix entry.
85 double m10;
87 /// The bottom, middle matrix entry.
88 double m11;
90 /// The bottom, right matrix entry.
91 double m12;
94 }; }; }; };
96 #endif