[Turn] matrix transformation of two-dimensional graphs (I.)--Basic concepts

Source: Internet
Author: User

Source: http://www.cnblogs.com/TianFang/p/3920734.html

The basic two-dimensional transformations can include rotation, scaling, twisting, and four kinds of peaceful movement,

These geometric operations can be converted to some basic matrix operations:

These transformations are linear, but the translation operation is not linear and cannot be done by 2*2 matrix operation. To shift the point (2, 1) in the x direction by 3 units, pan it in the y direction by 4 units. You can do this by first using matrix multiplication and then using matrix addition.

Combining these basic operations, mathematicians unify them into a 3*3 matrix, which is stored in the following form:

Since the third column of the matrix that represents the affine transformation is always (0,0,1), most of the time the matrix is stored as a 2*3 array.

Origin of the transformation

The reference point of a two-dimensional transformation is very important, such as the following rotation results are quite different:

Of course, there is a special kind of transformation except. That's the translation transformation, no matter what the origin is, the result of the transformation is unchanged.

Composite transformations

The matrix of a composite transformation can be obtained by multiplying several individual transformation matrices, which means that any sequence of affine transformations can be stored in a single Matrix object.

It is important to note that the composite transforms are sequential, in general, rotated, scaled, and then panned, with the first scaling, then rotation, and then panning being different.

Inverse matrix

The inverse matrix of a matrix can be calculated according to certain operations, and the matrix can be used to find out the position of the new coordinate point in the original coordinate system. However, it is important to note that not all matrices are reversible, and the invertible matrix requires a non-singular matrix.

Online preview

Microsoft has a geometric transformation of the online preview of the page, can be very intuitive to help us understand these transformations, interested friends may wish to try.

Http://ie.microsoft.com/testdrive/Graphics/hands-on-css3/hands-on_2d-transforms.htm

Summary

Matrix operation is a very basic mathematical knowledge, in the graphics of the application is still very extensive, but the University of the time often do not know what to use, and now use the time but forgot what the principle. This article only introduces some basic concepts of matrix operations, the detailed content can refer to the following reference. The next article simply introduces the actual use of matrix transformations.

Resources:

    1. HTTP://MSDN.MICROSOFT.COM/ZH-CN/LIBRARY/8667DCHF (v=vs.110). aspx
    2. http://msdn.microsoft.com/zh-cn/library/ms750596 (v=vs.110). aspx
    3. http://www.zhangxinxu.com/wordpress/2012/06/css3-transform-matrix-%E7%9F%A9%E9%98%B5/
    4. Http://netclass.csu.edu.cn/NCourse/hep089/Chapter6/CG_Txt_6_011.htm
    5. http://www.zhangxinxu.com/wordpress/2012/06/css3-transform-matrix-%E7%9F%A9%E9%98%B5/

[Turn] matrix transformation of two-dimensional graphs (I.)--Basic concepts

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.