Skip to content

Commit 49d4f26

Browse files
authored
Update
1 parent 1a79990 commit 49d4f26

1 file changed

Lines changed: 55 additions & 1 deletion

File tree

‎CustomView/Advance/[9]Matrix_Basic.md‎

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,66 @@ Matrix 是一个矩阵,肯定会涉及到一些比较麻烦的理论知识,
114114
115115
线性变换主要有3种: 缩放(scale)、旋转(rotate) 和 错切(skew)。
116116
117-
下面我们就以坐标映射的角度来讲讲这几种操作。
117+
线性变换均可用矩阵乘法完成(不了解矩阵乘法规则的参考下面维基百科),下面我们就来讲讲这几种操作。
118+
119+
**[维基百科-矩阵乘法](https://zh.wikipedia.org/wiki/%E7%9F%A9%E9%99%A3%E4%B9%98%E6%B3%95)**
118120
119121
#### a.缩放
120122
121123
以点(10,10)为例,我们将x缩放到原来到0.5倍,y缩放到原来到2倍,我们可以轻易到算出结果:(10x0.5, 10x2) = (5, 20)
122124
125+
矩阵计算公式:
126+
127+
![](http://latex.codecogs.com/png.latex?
128+
$$
129+
\\left [
130+
\\begin{matrix}
131+
X\\\\
132+
Y
133+
\\end{1}
134+
\\right ]
135+
=
136+
\\left [
137+
\\begin{matrix}
138+
Scale\\_X & 0 \\\\
139+
0 & Scale\\_Y
140+
\\end{1}
141+
\\right ]
142+
.
143+
\\left [
144+
\\begin{matrix}
145+
x\\\\
146+
y
147+
\\end{1}
148+
\\right ]
149+
$$)
150+
151+
152+
用计算示例:
153+
154+
![](http://latex.codecogs.com/png.latex?
155+
$$
156+
\\left [
157+
\\begin{matrix}
158+
5 \\\\
159+
20
160+
\\end{1}
161+
\\right ]
162+
=
163+
\\left [
164+
\\begin{matrix}
165+
0.5 & 0 \\\\
166+
0 & 2
167+
\\end{1}
168+
\\right ]
169+
.
170+
\\left [
171+
\\begin{matrix}
172+
10\\\\
173+
10
174+
\\end{1}
175+
\\right ]
176+
$$)
123177
124178
125179
### 四大常用操作

0 commit comments

Comments
 (0)