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 3 affine matrix.<p>
24 The matrix defined by this structure constitutes an affine mapping
25 of a point in 2D to another point in 2D. The last line of a
26 complete 3 by 3 matrix is omitted, since it is implicitly assumed
29 An affine mapping, as performed by this matrix, can be written out
30 as follows, where <code>xs</code> and <code>ys</code> are the source, and
31 <code>xd</code> and <code>yd</code> the corresponding result coordinates:
34 xd = m00*xs + m01*ys + m02;
35 yd = m10*xs + m11*ys + m12;
38 Thus, in common matrix language, with M being the
39 AffineMatrix2D and vs=[xs,ys]^T, vd=[xd,yd]^T two 2D
40 vectors, the affine transformation is written as
41 vd=M*vs. Concatenation of transformations amounts to
42 multiplication of matrices, i.e. a translation, given by T,
43 followed by a rotation, given by R, is expressed as vd=R*(T*vs) in
44 the above notation. Since matrix multiplication is associative,
45 this can be shortened to vd=(R*T)*vs=M'*vs. Therefore, a set of
46 consecutive transformations can be accumulated into a single
47 AffineMatrix2D, by multiplying the current transformation with the
48 additional transformation from the left.<p>
50 Due to this transformational approach, all geometry data types are
51 points in abstract integer or real coordinate spaces, without any
52 physical dimensions attached to them. This physical measurement
53 units are typically only added when using these data types to
54 render something onto a physical output device, like a screen or a
55 printer, Then, the total transformation matrix and the device
56 resolution determine the actual measurement unit.<p>
62 /// The top, left matrix entry.
65 /// The top, middle matrix entry.
68 /// The top, right matrix entry.
71 /// The bottom, left matrix entry.
74 /// The bottom, middle matrix entry.
77 /// The bottom, right matrix entry.
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */