This includes translation and Rotation Transformation. This is a very basic thing, that is, to extend the vector to a space that can be transformed. For example, to transform a three-dimensional color vector, it is extended into a five-dimensional space.
In my project, many images only have a set of transformation parameters and a reference pointing to the elements, that is, you need to use the transformation parameters to convert the element coordinates to the real display system coordinates to draw. When capturing these objects, You need to convert the mouse point to the coordinate system of the element.
Here are some notes: very basic, transformation and Inverse Transformation Code Omitted. /* **************************************** *****************************
* [Matrix]
* (1) the matrix equation of coordinate transformation is:
*
* [M11 M12 0]
* []
* [X 'y' 1] = [x y 1] [m21 m22 0]
* []
* [Dx Dy 0]
*
* (2) the transformation can be accumulated, and the transformation matrix is the result of multiplication of each transformation.
*
* (3) the inverse matrix of the transformation matrix is:
*
* [M22-M12 0]
* []
* [-M21 M11 0]/(M11 * m22-m12 * m22)
* []
* [-M22 * dx + m21 * dy M12 * dx-m11 * dy 1]
*
* (4) transformation matrix of the Post-offset method:
*
* X' = x * scale + dx
* Y' = y * scale + dy
*
* [Scale 0 0]
* [0 scale 0]
* [Dx dy 1]
*
*
* (5) rotate the transformation matrix of the angle around the origin (0, 0) (positive to the Y axis:
*
* X' = x * Cos (a)-y * sin ()
* Y' = x * sin (A) + y * Cos ()
*
* [Cos (a) sin (a) 0]
* [-Sin (a) Cos (a) 0]
* [0 0 0]
*
* (6) First rotate a degree forward around the origin point, then zooming it, and then translate the transformation matrix of DX and Dy:
* X' = x * Cos (a) * z-y * sin (a) * z + dx
* Y' = x * sin (a) * z + y * Cos (a) * z + dy
*
*
* [Cos (a) * Z sin (a) * z 0]
* [-Sin (a) * z cos (a) * z 0]
* [Dx Dy 0]
*
* (7) the inverse transformation of the above formula is:
* X = x' * Cos (a)/Z + y * sin (a)/Z-(dx * Cos (A) + dy * sin (A)/Z
* Y = x' *-sin (a)/Z + y * Cos (a)/Z + (dx * sin (a)-dy * Cos (A)/Z
*
*
* [Cos (a)-sin (a) 0]
* [Sin (a) Cos (a) 0]/Z
* [-DX * Cos (a)-dy * sin (a) dx * sin (a)-dy * Cos (a) 0]
*
*
**************************************** ****************************** */