Geometric transformation of Vector Space

Source: Internet
Author: User
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]
*
*
**************************************** ****************************** */  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.