Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use Matrix in css3

Shulou Source: shulou.com Published: 2022-05-31 12:40:00 10月03日 Update

Most people do not understand the knowledge points of this article "how to use matrices in css3", so the editor summarizes the following contents, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to use matrices in css3" article.

The change of css3 matrix. The application format is:

Transform: matrix (a _

It corresponds to:

The transformations in practical applications are:

Where:

Ax+cy+e = Abscissa

Bx+dy+f = ordinate

Why is there an extra 0 01? Because, in order to put together the parameters.

Translate matrix

The basic format is:

Transform: matrix (1,0,0,1, X, Y); / / X Transverse Translation, Y Longitudinal Translation

Scale matrix

The scale matrix is also quite simple.

/ / scale the X axis A times / / scale the Y axis B times matrix (A, 0P 0, B, 0 P 0)

Of course, if you write a number in the last two digits, it means zoom and then pan.

/ / get: X axis = 0.3cm x + 100ppm / get: y axis = 0.2cm x + 200matrix (0.3jing0jing0meme 0.2100200)

Rotate matrix

Rotate actually has a lot to do with trigonometric functions. First, determine your rotation angle (clockwise). Then, sin θ and cos θ are calculated. The final matrix formula is:

Matrix (cos θ, sin θ,-sin θ, cos θ, 0meme0) / / is cs-sc

Skew matrix

The skew (stretch) matrix is also a trigonometric function, but tan θ is used. The format is:

/ / tilt the Y axis to the X axis A °/ / tilt the X axis to the Y axis B °matrix (1Magi tan (A), tan (B), 1J 0J 0)

3D transformation matrix

The 3 D transformation is a matrix of 4 to 4. It is similar to 2D, except that it has an extra Z. / / this is a scaled 3D matrix.

The corresponding css is written as follows:

Transform: matrix3d (sx, 0,0,0,0, sy, 0,0,0,0, sz, 0,0,0,0,1) above is about the content of this article "how to use matrices in css3". I believe you all have some understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please pay attention to the industry information channel.

Tags: Matrix content that is format translation trigonometric function function reality article knowledge article triangle transformation application great representative value formula writing parameter Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Shulou Technology Huawei Shulou Information Apple