At the end of the second class of GAMS101, Mr. Yan introduced the matrix Matrices after explaining the basic knowledge of vectors.
1) Matrix and vector multiplication
Think of vectors as column vectors (i.e. matrices) with matrices on the left and vectors on the right.
Example: In a two-dimensional plane, perform y-axis symmetric operations on vectors.
Given any point (x,y), when the y-axis is used as the axis of symmetry, the symmetrical point is (-x,y).
If we have a matrix at this point , multiplying this matrix by the vector (x,y), we get
In this way, we realize the y-axis symmetric reflection operation on the vector through the matrix.
The point product and cross product of vectors can also be expressed in matrix form
In the third class, we mainly learn to realize the transformation of graphics through matrices.
In graphics, matrices are widely used to represent transformations. (In Graphics, pervasively used to represent transformations)
2) Two-dimensional transformation
Scale scaling transformation
Reflection reflection transformation
Shear transformation
Rotate rotation transformation
For the above four transformations, we use the Rotate transformation to explain.
In two-dimensional transformation, assuming an original point (x, y), after some transformation, becomes (x', y'), written as an expression
Among them, is called the transformation matrix.
When solving the transformation matrix , we can select the values of special points before and after transformation, and bring them into the expression for evaluation.
Rotation transformation. When rotating the angle, we select two special points (1,0) and (0,1) respectively. After the two points are rotated, the transformed positions become and respectively . We bring back the expression , can get
We expand the above two expressions in turn to get the following:
,get
,get
and
,get
,get
Putting the obtained value back into the expression, we get
In this way, we get the transformation matrix for rotation.
We can uniformly write the four transformations of scaling, reflection, shearing, and rotation as the following formula:
We call them Linear Transforms.
However, if we discuss the Translation translation transformation again, we will find that
The expression is
Among them, represents the translation amount of x and y.
In order to unify linear transformations such as scaling, reflection, shearing, and rotation, and nonlinear transformations such as translation transformations into a matrix form, we artificially introduce Homogeneous Coordinates.
In 2D coordinates, we add a third coordinate. We stipulate:
If the third coordinate is 1, it means a two-dimensional point;
If the third one is 0, it means a two-dimensional vector;
We use homogeneous coordinates to accomplish the appeal of various transformations in a unified matrix form.
After completing the uniform matrix form, we can study the properties of the transformation by studying the matrix.
inverse transform
combination of transformations
transformation decomposition
3) Three-dimensional transformation
On the basis of two dimensions, we extend to three dimensions.
In three-dimensional homogeneous coordinates, we unify the three-dimensional matrix form.