update dev300-m58
[ooovba.git] / offapi / com / sun / star / geometry / Matrix2D.idl
blob8e9e9b93ef96cac0c99450d229615ae6348eaa46
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: Matrix2D.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_Matrix2D_idl__
31 #define __com_sun_star_geometry_Matrix2D_idl__
33 module com { module sun { module star { module geometry {
35 /** This structure defines a 2 by 2 matrix.<p>
37 This constitutes a linear mapping of a point in 2D to another
38 point in 2D.<p>
40 The matrix defined by this structure constitutes a linear
41 mapping of a point in 2D to another point in 2D. In contrast to
42 the <type>com.sun.star.geometry.AffineMatrix2D</type>, this
43 matrix does not include any translational components.<p>
45 A linear mapping, as performed by this matrix, can be written out
46 as follows, where <code>xs</code> and <code>ys</code> are the source, and
47 <code>xd</code> and <code>yd</code> the corresponding result coordinates:
49 <code>
50 xd = m00*xs + m01*ys;
51 yd = m10*xs + m11*ys;
52 </code><p>
54 Thus, in common matrix language, with M being the
55 <type>Matrix2D</type> and vs=[xs,ys]^T, vd=[xd,yd]^T two 2D
56 vectors, the linear mapping is written as
57 vd=M*vs. Concatenation of transformations amounts to
58 multiplication of matrices, i.e. a scaling, given by S,
59 followed by a rotation, given by R, is expressed as vd=R*(S*vs) in
60 the above notation. Since matrix multiplication is associative,
61 this can be shortened to vd=(R*S)*vs=M'*vs. Therefore, a set of
62 consecutive transformations can be accumulated into a single
63 Matrix2D, by multiplying the current transformation with the
64 additional transformation from the left.<p>
66 Due to this transformational approach, all geometry data types are
67 points in abstract integer or real coordinate spaces, without any
68 physical dimensions attached to them. This physical measurement
69 units are typically only added when using these data types to
70 render something onto a physical output device, like a screen or a
71 printer. Then, the total transformation matrix and the device
72 resolution determine the actual measurement unit.<p>
74 @since OOo 2.0.0
76 struct Matrix2D
78 /// The top, left matrix entry.
79 double m00;
81 /// The top, right matrix entry.
82 double m01;
84 /// The bottom, left matrix entry.
85 double m10;
87 /// The bottom, right matrix entry.
88 double m11;
91 }; }; }; };
93 #endif