The Free and Open Productivity Suite
Apache OpenOffice 4.1.4 released

Developer's Guide



Tips 'n' Tricks


:: com :: sun :: star :: geometry ::

struct Matrix2D
This structure defines a 2 by 2 matrix.

This constitutes a linear mapping of a point in 2D to another point in 2D.

The matrix defined by this structure constitutes a linear mapping of a point in 2D to another point in 2D. In contrast to the, this matrix does not include any translational components.

A linear mapping, as performed by this matrix, can be written out as follows, where xs and ys are the source, and xd and yd the corresponding result coordinates: xd = m00*xs + m01*ys; yd = m10*xs + m11*ys;

Thus, in common matrix language, with M being the Matrix2D and vs=[xs,ys]^T, vd=[xd,yd]^T two 2D vectors, the linear mapping is written as vd=M*vs. Concatenation of transformations amounts to multiplication of matrices, i.e. a scaling, given by S, followed by a rotation, given by R, is expressed as vd=R*(S*vs) in the above notation. Since matrix multiplication is associative, this can be shortened to vd=(R*S)*vs=M'*vs. Therefore, a set of consecutive transformations can be accumulated into a single Matrix2D, by multiplying the current transformation with the additional transformation from the left.

Due to this transformational approach, all geometry data types are points in abstract integer or real coordinate spaces, without any physical dimensions attached to them. This physical measurement units are typically only added when using these data types to render something onto a physical output device, like a screen or a printer. Then, the total transformation matrix and the device resolution determine the actual measurement unit.

OOo 2.0

Elements' Summary
m00 The top, left matrix entry. 
m01 The top, right matrix entry. 
m10 The bottom, left matrix entry. 
m11 The bottom, right matrix entry. 
Elements' Details
double m00;
The top, left matrix entry.
double m01;
The top, right matrix entry.
double m10;
The bottom, left matrix entry.
double m11;
The bottom, right matrix entry.
Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache and the Apache feather logo are trademarks of The Apache Software Foundation. OpenOffice, and the seagull logo are registered trademarks of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.