Skip to content

Commit c0e97d5

Browse files
authored
Update 700-math-m3scale.markdown
1 parent 642ef1c commit c0e97d5

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

_build/reference/700-math-m3scale.markdown

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
# M3SCALE
22

3-
> M3SCALE BYREF m3x3, x, y, Sx, Sy
3+
> M3SCALE BYREF M, Ox, Oy, Sx, Sy
44
5-
Multiply the given matrix by a scale matrix. Sx and Sy are the scaling factors in x and y direction.
5+
Multiply the 2D transformation matrix `M` by a scale matrix. `Sx` and `Sy` are the scaling factors in x and y direction. `Ox` and `Oy` define the position of the origin.
6+
7+
If `Ox = 0` and `Oy = 0` then the scaling matrix `M` has the form:
8+
9+
```
10+
|Sx 0 0|
11+
MScale = |0 Sy 0|
12+
|0 0 1|
13+
```
14+
15+
else:
616

717
```
8-
| Sx 0 0|
9-
MScale = | 0 Sy 0|
10-
| 0 0 1|
18+
|1 0 Ox| |Sx 0 0| |1 0 -Ox| |Sx 0 (1 - Sx) * Ox|
19+
MScale = |0 1 Oy| * | 0 Sy 0| * |0 1 -Oy| = | 0 Sy (1 - Sy) * Oy|
20+
|0 0 1| | 0 0 1| |0 0 1| | 0 0 1|
1121
```
1222

23+
### Example
24+
1325
```
1426
DIM M(2,2)
1527

0 commit comments

Comments
 (0)