矩阵变换:Scaling、Dilation、Rotation 和 Reflection对应的中文是什么?(中英双语)

发布于:2024-12-19 ⋅ 阅读:(10) ⋅ 点赞:(0)

中文版

矩阵变换:Scaling、Dilation、Rotation 和 Reflection

在二维或三维空间中,矩阵变换是一种通过矩阵与向量相乘,来实现从一个点到另一个点的映射过程。今天,我们将深入探讨四种常见的几何变换:Scaling(缩放)Dilation(膨胀)Rotation(旋转)Reflection(反射),并通过矩阵和简单的例子来理解这些变换。

1. Scaling(缩放)

缩放是指通过一个标量因子对向量进行放大或缩小的操作。假设我们有一个二维向量 ( x = ( x 1 x 2 ) x = \begin{pmatrix} x_1 \\ x_2 \end{pmatrix} x=(x1x2) ),其经过缩放后变成一个新向量 ( y = ( y 1 y 2 ) y = \begin{pmatrix} y_1 \\ y_2 \end{pmatrix} y=(y1y2) )。如果缩放因子是 ( a a a ),那么我们得到:

y = a x y = a x y=ax

这里,矩阵 ( A A A ) 就是 ( a I aI aI ),其中 ( I I I ) 是单位矩阵,表示:

A = ( a 0 0 a ) A = \begin{pmatrix} a & 0 \\ 0 & a \end{pmatrix} A=(a00a)

缩放的效果:

  • 如果 ( ∣ a ∣ > 1 |a| > 1 a>1 ),那么向量会被放大。
  • 如果 ( ∣ a ∣ < 1 |a| < 1 a<1 ),那么向量会被缩小。
  • 如果 ( a < 0 a < 0 a<0 ),向量的方向会反转。

举个例子:

假设原始向量是 ( x = ( 2 3 ) x = \begin{pmatrix} 2 \\ 3 \end{pmatrix} x=(23) ),如果缩放因子 ( a = 2 a = 2 a=2 ),那么:

y = 2 × ( 2 3 ) = ( 4 6 ) y = 2 \times \begin{pmatrix} 2 \\ 3 \end{pmatrix} = \begin{pmatrix} 4 \\ 6 \end{pmatrix} y=2×(23)=(46)

可以看到,原来的向量被放大了。

2. Dilation(膨胀)

膨胀变换是一种沿着不同轴分别伸缩的操作。假设我们有一个二维向量 ( x = ( x 1 x 2 ) x = \begin{pmatrix} x_1 \\ x_2 \end{pmatrix} x=(x1x2) ),并且膨胀矩阵 ( D D D ) 是一个对角矩阵:

D = ( d 1 0 0 d 2 ) D = \begin{pmatrix} d_1 & 0 \\ 0 & d_2 \end{pmatrix} D=(d100d2)

则变换后的向量是:

y = D x = ( d 1 x 1 d 2 x 2 ) y = D x = \begin{pmatrix} d_1 x_1 \\ d_2 x_2 \end{pmatrix} y=Dx=(d1x1d2x2)

膨胀的效果:

  • 如果 ( ∣ d 1 ∣ > 1 |d_1| > 1 d1>1 ),则沿 ( x 1 x_1 x1 ) 轴放大,反之缩小。
  • 如果 ( ∣ d 2 ∣ > 1 |d_2| > 1 d2>1 ),则沿 ( x 2 x_2 x2 ) 轴放大,反之缩小。
  • 如果 ( d 1 d_1 d1 ) 或 ( d 2 d_2 d2 ) 为负数,向量会在相应的轴上翻转。

举个例子:

假设原始向量是 ( x = ( 2 3 ) x = \begin{pmatrix} 2 \\ 3 \end{pmatrix} x=(23) ),膨胀矩阵是 ( D = ( 2 0 0 0.5 ) D = \begin{pmatrix} 2 & 0 \\ 0 & 0.5 \end{pmatrix} D=(2000.5) ),那么变换后的向量是:

y = ( 2 0 0 0.5 ) ( 2 3 ) = ( 4 1.5 ) y = \begin{pmatrix} 2 & 0 \\ 0 & 0.5 \end{pmatrix} \begin{pmatrix} 2 \\ 3 \end{pmatrix} = \begin{pmatrix} 4 \\ 1.5 \end{pmatrix} y=(2000.5)(23)=(41.5)

可以看到,沿 ( x 1 x_1 x1 ) 轴放大了,而沿 ( x 2 x_2 x2 ) 轴缩小了。

3. Rotation(旋转)

旋转变换是指将向量绕原点旋转一个角度 ( θ \theta θ )。假设原始向量是 ( x = ( x 1 x 2 ) x = \begin{pmatrix} x_1 \\ x_2 \end{pmatrix} x=(x1x2) ),旋转后的向量 ( y y y ) 可以通过以下矩阵与向量相乘得到:

y = ( cos ⁡ θ − sin ⁡ θ sin ⁡ θ cos ⁡ θ ) ( x 1 x 2 ) y = \begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix} \begin{pmatrix} x_1 \\ x_2 \end{pmatrix} y=(cosθsinθsinθcosθ)(x1x2)

这是一个旋转矩阵,它表示向量绕原点旋转 ( θ \theta θ ) 弧度。

旋转的效果:

  • 向量 ( x x x ) 被绕原点顺时针或逆时针旋转。
  • 旋转矩阵可以通过不同的角度 ( θ \theta θ ) 来调整旋转的方向和幅度。

举个例子:

假设原始向量是 ( x = ( 1 0 ) x = \begin{pmatrix} 1 \\ 0 \end{pmatrix} x=(10) ),我们将其逆时针旋转 90 度,即 ( θ = π 2 \theta = \frac{\pi}{2} θ=2π )。那么旋转矩阵为:

( cos ⁡ π 2 − sin ⁡ π 2 sin ⁡ π 2 cos ⁡ π 2 ) = ( 0 − 1 1 0 ) \begin{pmatrix} \cos\frac{\pi}{2} & -\sin\frac{\pi}{2} \\ \sin\frac{\pi}{2} & \cos\frac{\pi}{2} \end{pmatrix} = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} (cos2πsin2πsin2πcos2π)=(0110)

旋转后的向量是:

y = ( 0 − 1 1 0 ) ( 1 0 ) = ( 0 1 ) y = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 1 \end{pmatrix} y=(0110)(10)=(01)

向量成功地绕原点旋转了 90 度,变成了 ( ( 0 1 ) \begin{pmatrix} 0 \\ 1 \end{pmatrix} (01) )。

4. Reflection(反射)

反射变换是指将向量通过某个指定的直线反射。假设我们要将向量 ( x x x ) 反射到一个通过原点的直线上,该直线与水平轴的夹角为 ( θ \theta θ )。反射矩阵为:

y = ( cos ⁡ ( 2 θ ) sin ⁡ ( 2 θ ) sin ⁡ ( 2 θ ) − cos ⁡ ( 2 θ ) ) x y = \begin{pmatrix} \cos(2\theta) & \sin(2\theta) \\ \sin(2\theta) & -\cos(2\theta) \end{pmatrix} x y=(cos(2θ)sin(2θ)sin(2θ)cos(2θ))x

反射的效果:

  • 向量会沿着指定的直线反射,反射后的方向与原来的方向对称。

举个例子:

假设原始向量是 ( x = ( 1 1 ) x = \begin{pmatrix} 1 \\ 1 \end{pmatrix} x=(11) ),我们希望通过与水平轴成 45 度角的直线反射,即 ( θ = π 4 \theta = \frac{\pi}{4} θ=4π ),则反射矩阵为:

( cos ⁡ π 2 sin ⁡ π 2 sin ⁡ π 2 − cos ⁡ π 2 ) = ( 0 1 1 0 ) \begin{pmatrix} \cos\frac{\pi}{2} & \sin\frac{\pi}{2} \\ \sin\frac{\pi}{2} & -\cos\frac{\pi}{2} \end{pmatrix} = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} (cos2πsin2πsin2πcos2π)=(0110)

反射后的向量是:

y = ( 0 1 1 0 ) ( 1 1 ) = ( 1 1 ) y = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} 1 \\ 1 \end{pmatrix} = \begin{pmatrix} 1 \\ 1 \end{pmatrix} y=(0110)(11)=(11)

虽然反射的结果在此例中与原始向量相同,但如果角度不同,反射后向量将改变。


总结

通过矩阵与向量相乘,我们可以实现多种几何变换。理解这些变换有助于我们在计算机图形学、机器人学等领域进行更复杂的空间变换。

英文版

Matrix Transformations: Scaling, Dilation, Rotation, and Reflection

In 2D or 3D space, matrix transformations provide a way to map points from one position to another by multiplying a matrix with a vector. In this post, we’ll explore four common geometric transformations: Scaling, Dilation, Rotation, and Reflection, and explain each concept with simple examples.

1. Scaling

Scaling refers to resizing a vector by a scalar factor. Suppose we have a 2D vector ( x = ( x 1 x 2 ) x = \begin{pmatrix} x_1 \\ x_2 \end{pmatrix} x=(x1x2) ), and after scaling, it becomes a new vector ( y = ( y 1 y 2 ) y = \begin{pmatrix} y_1 \\ y_2 \end{pmatrix} y=(y1y2) ). If the scaling factor is ( a a a ), then the transformation is:

y = a x y = a x y=ax

In matrix form, this is represented by ( A = a I A = aI A=aI ), where ( I I I ) is the identity matrix:

A = ( a 0 0 a ) A = \begin{pmatrix} a & 0 \\ 0 & a \end{pmatrix} A=(a00a)

Effects of Scaling:

  • If ( ∣ a ∣ > 1 |a| > 1 a>1 ), the vector is stretched (scaled up).
  • If ( ∣ a ∣ < 1 |a| < 1 a<1 ), the vector is shrunk (scaled down).
  • If ( a < 0 a < 0 a<0 ), the direction of the vector is reversed (flipped).

Example:

Suppose the original vector is ( x = ( 2 3 ) x = \begin{pmatrix} 2 \\ 3 \end{pmatrix} x=(23) ), and the scaling factor ( a = 2 a = 2 a=2 ). Then:

y = 2 × ( 2 3 ) = ( 4 6 ) y = 2 \times \begin{pmatrix} 2 \\ 3 \end{pmatrix} = \begin{pmatrix} 4 \\ 6 \end{pmatrix} y=2×(23)=(46)

The vector has been scaled up by a factor of 2.

2. Dilation

Dilation is a transformation that stretches the vector by different factors along each axis. Suppose the vector ( x = ( x 1 x 2 ) x = \begin{pmatrix} x_1 \\ x_2 \end{pmatrix} x=(x1x2) ) undergoes dilation by a diagonal matrix ( D D D ):

D = ( d 1 0 0 d 2 ) D = \begin{pmatrix} d_1 & 0 \\ 0 & d_2 \end{pmatrix} D=(d100d2)

Then the transformed vector ( y y y ) is:

y = D x = ( d 1 x 1 d 2 x 2 ) y = D x = \begin{pmatrix} d_1 x_1 \\ d_2 x_2 \end{pmatrix} y=Dx=(d1x1d2x2)

Effects of Dilation:

  • If ( ∣ d 1 ∣ > 1 |d_1| > 1 d1>1 ), the vector is stretched along the ( x 1 x_1 x1 )-axis.
  • If ( ∣ d 2 ∣ > 1 |d_2| > 1 d2>1 ), the vector is stretched along the ( x 2 x_2 x2 )-axis.
  • If ( d 1 d_1 d1 ) or ( d 2 d_2 d2 ) is negative, the vector is flipped along the corresponding axis.

Example:

Suppose the original vector is ( x = ( 2 3 ) x = \begin{pmatrix} 2 \\ 3 \end{pmatrix} x=(23) ), and the dilation matrix is ( D = ( 2 0 0 0.5 ) D = \begin{pmatrix} 2 & 0 \\ 0 & 0.5 \end{pmatrix} D=(2000.5) ). Then:

y = ( 2 0 0 0.5 ) ( 2 3 ) = ( 4 1.5 ) y = \begin{pmatrix} 2 & 0 \\ 0 & 0.5 \end{pmatrix} \begin{pmatrix} 2 \\ 3 \end{pmatrix} = \begin{pmatrix} 4 \\ 1.5 \end{pmatrix} y=(2000.5)(23)=(41.5)

Here, the vector is stretched along the ( x 1 x_1 x1 )-axis and shrunk along the ( x 2 x_2 x2 )-axis.

3. Rotation

Rotation refers to rotating a vector around the origin by an angle ( θ \theta θ ). Suppose the original vector is ( x = ( x 1 x 2 ) x = \begin{pmatrix} x_1 \\ x_2 \end{pmatrix} x=(x1x2) ). After rotating by ( θ \theta θ ) radians counterclockwise, the transformed vector ( y y y ) is given by:

y = ( cos ⁡ θ − sin ⁡ θ sin ⁡ θ cos ⁡ θ ) ( x 1 x 2 ) y = \begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix} \begin{pmatrix} x_1 \\ x_2 \end{pmatrix} y=(cosθsinθsinθcosθ)(x1x2)

This is called the rotation matrix.

Effects of Rotation:

  • The vector ( x x x ) is rotated counterclockwise by the angle ( θ \theta θ ) around the origin.

Example:

Suppose the original vector is ( x = ( 1 0 ) x = \begin{pmatrix} 1 \\ 0 \end{pmatrix} x=(10) ), and we want to rotate it counterclockwise by 90 degrees, or ( θ = π 2 \theta = \frac{\pi}{2} θ=2π ). The rotation matrix is:

( cos ⁡ π 2 − sin ⁡ π 2 sin ⁡ π 2 cos ⁡ π 2 ) = ( 0 − 1 1 0 ) \begin{pmatrix} \cos\frac{\pi}{2} & -\sin\frac{\pi}{2} \\ \sin\frac{\pi}{2} & \cos\frac{\pi}{2} \end{pmatrix} = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} (cos2πsin2πsin2πcos2π)=(0110)

The rotated vector is:

y = ( 0 − 1 1 0 ) ( 1 0 ) = ( 0 1 ) y = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 1 \end{pmatrix} y=(0110)(10)=(01)

The vector has been rotated 90 degrees counterclockwise, resulting in ( ( 0 1 ) \begin{pmatrix} 0 \\ 1 \end{pmatrix} (01) ).

4. Reflection

Reflection is the transformation that mirrors a vector across a line through the origin. Suppose we reflect the vector ( x = ( x 1 x 2 ) x = \begin{pmatrix} x_1 \\ x_2 \end{pmatrix} x=(x1x2) ) across a line inclined at an angle ( θ \theta θ ) with respect to the horizontal axis. The reflection matrix is:

y = ( cos ⁡ ( 2 θ ) sin ⁡ ( 2 θ ) sin ⁡ ( 2 θ ) − cos ⁡ ( 2 θ ) ) x y = \begin{pmatrix} \cos(2\theta) & \sin(2\theta) \\ \sin(2\theta) & -\cos(2\theta) \end{pmatrix} x y=(cos(2θ)sin(2θ)sin(2θ)cos(2θ))x

Effects of Reflection:

  • The vector is reflected across the line at an angle ( θ \theta θ ), creating a mirror image.

Example:

Suppose the original vector is ( x = ( 1 1 ) x = \begin{pmatrix} 1 \\ 1 \end{pmatrix} x=(11) ), and we want to reflect it across a line at ( θ = π 4 \theta = \frac{\pi}{4} θ=4π ). The reflection matrix is:

( cos ⁡ π 2 sin ⁡ π 2 sin ⁡ π 2 − cos ⁡ π 2 ) = ( 0 1 1 0 ) \begin{pmatrix} \cos\frac{\pi}{2} & \sin\frac{\pi}{2} \\ \sin\frac{\pi}{2} & -\cos\frac{\pi}{2} \end{pmatrix} = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} (cos2πsin2πsin2πcos2π)=(0110)

The reflected vector is:

y = ( 0 1 1 0 ) ( 1 1 ) = ( 1 1 ) y = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} 1 \\ 1 \end{pmatrix} = \begin{pmatrix} 1 \\ 1 \end{pmatrix} y=(0110)(11)=(11)

In this specific example, the reflected vector is the same as the original one, but for other angles, the reflection would result in a new direction.


Conclusion

By multiplying matrices with vectors, we can perform a variety of geometric transformations. Understanding these transformations is essential for fields like computer graphics, robotics, and physics, where spatial transformations are commonly used. With this post, you should have a clearer understanding of Scaling, Dilation, Rotation, and Reflection matrices and how they can be applied to manipulate vectors in space!

后记

2024年12月18日22点52分于上海,在GPT4o大模型辅助下完成。