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