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_AffineMatrix2D_idl__
28 #define __com_sun_star_geometry_AffineMatrix2D_idl__
30 module com
{ module sun
{ module star
{ module geometry
{
32 /** This structure defines a 2 by 3 affine matrix.<p>
34 The matrix defined by this structure constitutes an affine mapping
35 of a point in 2D to another point in 2D. The last line of a
36 complete 3 by 3 matrix is omitted, since it is implicitely assumed
39 An affine mapping, as performed by this matrix, can be written out
40 as follows, where <code>xs</code> and <code>ys</code> are the source, and
41 <code>xd</code> and <code>yd</code> the corresponding result coordinates:
44 xd = m00*xs + m01*ys + m02;
45 yd = m10*xs + m11*ys + m12;
48 Thus, in common matrix language, with M being the
49 <type>AffineMatrix2D</type> and vs=[xs,ys]^T, vd=[xd,yd]^T two 2D
50 vectors, the affine transformation is written as
51 vd=M*vs. Concatenation of transformations amounts to
52 multiplication of matrices, i.e. a translation, given by T,
53 followed by a rotation, given by R, is expressed as vd=R*(T*vs) in
54 the above notation. Since matrix multiplication is associative,
55 this can be shortened to vd=(R*T)*vs=M'*vs. Therefore, a set of
56 consecutive transformations can be accumulated into a single
57 AffineMatrix2D, by multiplying the current transformation with the
58 additional transformation from the left.<p>
60 Due to this transformational approach, all geometry data types are
61 points in abstract integer or real coordinate spaces, without any
62 physical dimensions attached to them. This physical measurement
63 units are typically only added when using these data types to
64 render something onto a physical output device, like a screen or a
65 printer, Then, the total transformation matrix and the device
66 resolution determine the actual measurement unit.<p>
72 /// The top, left matrix entry.
75 /// The top, middle matrix entry.
78 /// The top, right matrix entry.
81 /// The bottom, left matrix entry.
84 /// The bottom, middle matrix entry.
87 /// The bottom, right matrix entry.