1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_geometry_AffineMatrix2D_idl__
24#define __com_sun_star_geometry_AffineMatrix2D_idl__
25
26module com {  module sun {  module star {  module geometry {
27
28/** This structure defines a 2 by 3 affine matrix.<p>
29
30    The matrix defined by this structure constitutes an affine mapping
31    of a point in 2D to another point in 2D. The last line of a
32    complete 3 by 3 matrix is omitted, since it is implicitely assumed
33    to be [0,0,1].<p>
34
35    An affine mapping, as performed by this matrix, can be written out
36    as follows, where <code>xs</code> and <code>ys</code> are the source, and
37    <code>xd</code> and <code>yd</code> the corresponding result coordinates:
38
39    <code>
40        xd = m00*xs + m01*ys + m02;
41        yd = m10*xs + m11*ys + m12;
42    </code><p>
43
44    Thus, in common matrix language, with M being the
45    <type>AffineMatrix2D</type> and vs=[xs,ys]^T, vd=[xd,yd]^T two 2D
46    vectors, the affine transformation is written as
47    vd=M*vs. Concatenation of transformations amounts to
48    multiplication of matrices, i.e. a translation, given by T,
49    followed by a rotation, given by R, is expressed as vd=R*(T*vs) in
50    the above notation. Since matrix multiplication is associative,
51    this can be shortened to vd=(R*T)*vs=M'*vs. Therefore, a set of
52    consecutive transformations can be accumulated into a single
53    AffineMatrix2D, by multiplying the current transformation with the
54    additional transformation from the left.<p>
55
56    Due to this transformational approach, all geometry data types are
57    points in abstract integer or real coordinate spaces, without any
58    physical dimensions attached to them. This physical measurement
59    units are typically only added when using these data types to
60    render something onto a physical output device, like a screen or a
61    printer, Then, the total transformation matrix and the device
62    resolution determine the actual measurement unit.<p>
63
64    @since OpenOffice 2.0
65 */
66published struct AffineMatrix2D
67{
68    /// The top, left matrix entry.
69    double m00;
70
71    /// The top, middle matrix entry.
72    double m01;
73
74    /// The top, right matrix entry.
75    double m02;
76
77    /// The bottom, left matrix entry.
78    double m10;
79
80    /// The bottom, middle matrix entry.
81    double m11;
82
83    /// The bottom, right matrix entry.
84    double m12;
85};
86
87}; }; }; };
88
89#endif
90