merged tag ooo/OOO330_m14
[LibreOffice.git] / offapi / com / sun / star / geometry / Matrix2D.idl
blob4d2bacb24e2ff2df6f27d37c6a09f4638ad2dfdb
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef __com_sun_star_geometry_Matrix2D_idl__
28 #define __com_sun_star_geometry_Matrix2D_idl__
30 module com { module sun { module star { module geometry {
32 /** This structure defines a 2 by 2 matrix.<p>
34 This constitutes a linear mapping of a point in 2D to another
35 point in 2D.<p>
37 The matrix defined by this structure constitutes a linear
38 mapping of a point in 2D to another point in 2D. In contrast to
39 the <type>com.sun.star.geometry.AffineMatrix2D</type>, this
40 matrix does not include any translational components.<p>
42 A linear 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;
48 yd = m10*xs + m11*ys;
49 </code><p>
51 Thus, in common matrix language, with M being the
52 <type>Matrix2D</type> and vs=[xs,ys]^T, vd=[xd,yd]^T two 2D
53 vectors, the linear mapping is written as
54 vd=M*vs. Concatenation of transformations amounts to
55 multiplication of matrices, i.e. a scaling, given by S,
56 followed by a rotation, given by R, is expressed as vd=R*(S*vs) in
57 the above notation. Since matrix multiplication is associative,
58 this can be shortened to vd=(R*S)*vs=M'*vs. Therefore, a set of
59 consecutive transformations can be accumulated into a single
60 Matrix2D, 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 Matrix2D
75 /// The top, left matrix entry.
76 double m00;
78 /// The top, right matrix entry.
79 double m01;
81 /// The bottom, left matrix entry.
82 double m10;
84 /// The bottom, right matrix entry.
85 double m11;
88 }; }; }; };
90 #endif