1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 module com
{ module sun
{ module star
{ module geometry
{
22 /** This structure defines a 2 by 2 matrix.<p>
24 This constitutes a linear mapping of a point in 2D to another
27 The matrix defined by this structure constitutes a linear
28 mapping of a point in 2D to another point in 2D. In contrast to
29 the com.sun.star.geometry.AffineMatrix2D, this
30 matrix does not include any translational components.<p>
32 A linear mapping, as performed by this matrix, can be written out
33 as follows, where <code>xs</code> and <code>ys</code> are the source, and
34 <code>xd</code> and <code>yd</code> the corresponding result coordinates:
41 Thus, in common matrix language, with M being the
42 Matrix2D and vs=[xs,ys]^T, vd=[xd,yd]^T two 2D
43 vectors, the linear mapping is written as
44 vd=M*vs. Concatenation of transformations amounts to
45 multiplication of matrices, i.e. a scaling, given by S,
46 followed by a rotation, given by R, is expressed as vd=R*(S*vs) in
47 the above notation. Since matrix multiplication is associative,
48 this can be shortened to vd=(R*S)*vs=M'*vs. Therefore, a set of
49 consecutive transformations can be accumulated into a single
50 Matrix2D, by multiplying the current transformation with the
51 additional transformation from the left.<p>
53 Due to this transformational approach, all geometry data types are
54 points in abstract integer or real coordinate spaces, without any
55 physical dimensions attached to them. This physical measurement
56 units are typically only added when using these data types to
57 render something onto a physical output device, like a screen or a
58 printer. Then, the total transformation matrix and the device
59 resolution determine the actual measurement unit.<p>
65 /// The top, left matrix entry.
68 /// The top, right matrix entry.
71 /// The bottom, left matrix entry.
74 /// The bottom, right matrix entry.
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */