如图,平面坐标系内点A(
x
a
x_{a}
xa,
y
a
y_{a}
ya)绕原点O逆时针旋转至点B(
x
b
x_{b}
xb,
y
b
y_{b}
yb),OB与OA的夹角为
θ
\theta
θ,试用矩阵表示点B与点A的关系。
解:设OA的长度为r,OA与
x
x
x轴的夹角为
α
\alpha
α,则
x b x a = r c o s ( α + θ ) r c o s α = c o s α c o s θ − s i n α s i n θ c o s α = c o s θ − t a n α s i n θ = c o s θ − y a x a s i n θ \frac{x_{b}}{x_{a}} = \frac{rcos(\alpha + \theta)}{rcos\alpha} = \frac{cos\alpha cos\theta - sin\alpha sin\theta}{cos\alpha}=cos\theta - tan\alpha sin\theta = cos\theta - \frac{y_{a}}{x_{a}} sin\theta xaxb=rcosαrcos(α+θ)=cosαcosαcosθ−sinαsinθ=cosθ−tanαsinθ=cosθ−xayasinθ
y b y a = r s i n ( α + θ ) r s i n α = s i n α c o s θ + c o s α s i n θ s i n α = c o s θ + c o t α s i n θ = c o s θ + x a y a s i n θ \frac{y_{b}}{y_{a}} = \frac{rsin(\alpha + \theta)}{rsin\alpha} = \frac{sin\alpha cos\theta + cos\alpha sin\theta}{sin\alpha}=cos\theta + cot\alpha sin\theta = cos\theta + \frac{x_{a}}{y_{a}} sin\theta yayb=rsinαrsin(α+θ)=sinαsinαcosθ+cosαsinθ=cosθ+cotαsinθ=cosθ+yaxasinθ
移项得
x
b
=
x
a
c
o
s
θ
−
y
a
s
i
n
θ
x_{b} = x_{a} cos\theta - y_{a} sin\theta
xb=xacosθ−yasinθ
y b = x a s i n θ + y a c o s θ y_{b} = x_{a} sin\theta + y_{a} cos\theta yb=xasinθ+yacosθ
写成矩阵的表示方式
[
x
b
y
b
]
=
[
c
o
s
θ
−
s
i
n
θ
s
i
n
θ
c
o
s
θ
]
[
x
a
y
a
]
\begin{bmatrix} x_{b} \\ y_{b} \end{bmatrix} = \begin{bmatrix} cos\theta & -sin\theta \\ sin\theta & cos\theta \end{bmatrix} \begin{bmatrix} x_{a} \\ y_{a} \end{bmatrix}
[xbyb]=[cosθsinθ−sinθcosθ][xaya]
延伸:OB以原点缩放
λ
\lambda
λ倍至点C(
x
c
x_{c}
xc,
y
c
y_{c}
yc),即
∣
O
C
∣
=
λ
∣
O
B
∣
\left | OC \right | = \lambda \left | OB \right |
∣OC∣=λ∣OB∣,则
[
x
c
y
c
]
=
[
λ
0
0
λ
]
[
x
b
y
b
]
=
[
λ
0
0
λ
]
[
c
o
s
θ
−
s
i
n
θ
s
i
n
θ
c
o
s
θ
]
[
x
a
y
a
]
=
[
λ
c
o
s
θ
−
λ
s
i
n
θ
λ
s
i
n
θ
λ
c
o
s
θ
]
[
x
a
y
a
]
\begin{bmatrix} x_{c} \\ y_{c} \end{bmatrix} = \begin{bmatrix} \lambda & 0 \\ 0 & \lambda \end{bmatrix} \begin{bmatrix} x_{b} \\ y_{b} \end{bmatrix} = \begin{bmatrix} \lambda & 0 \\ 0 & \lambda \end{bmatrix} \begin{bmatrix} cos\theta & -sin\theta \\ sin\theta & cos\theta \end{bmatrix} \begin{bmatrix} x_{a} \\ y_{a} \end{bmatrix} = \begin{bmatrix} \lambda cos\theta & -\lambda sin\theta \\ \lambda sin\theta & \lambda cos\theta \end{bmatrix} \begin{bmatrix} x_{a} \\ y_{a} \end{bmatrix}
[xcyc]=[λ00λ][xbyb]=[λ00λ][cosθsinθ−sinθcosθ][xaya]=[λcosθλsinθ−λsinθλcosθ][xaya]
由此可知,平面坐标系内任意一点和另外一点都可以确定一个矩阵变换,这个变换是规律性的旋转、缩放。可以看出矩阵向量是正交的,原因是在正交坐标系下推导导致的,如果这个矩阵是任意的2x2矩阵,代表的意义是什么?参考点积和投影