my test site
Open main menu
Learning
Course 2
Computer Graphics
Vertex Processing
Affine Transform - Scaling
Affine Transform - Scaling
#Computer_Graphics
Scaling example in 2D
Scaling in 3D (a vector is scaled through
matrix multiplication
)
(
s
x
0
0
0
s
y
0
0
0
s
z
)
(
x
y
z
)
=
(
s
x
x
s
y
y
s
z
z
)
\begin{pmatrix} s_{x} & 0 & 0 \\ 0 & s_{y} & 0 \\ 0 & 0 & s_{z} \end{pmatrix} \begin{pmatrix} x \\ y \\ z \end{pmatrix} = \begin{pmatrix} s_{x}x \\ s_{y}y \\ s_{z}z \end{pmatrix}
s
x
0
0
0
s
y
0
0
0
s
z
x
y
z
=
s
x
x
s
y
y
s
z
z
If all of the scaling factors
s
x
s_x
s
x
,
s
y
s_y
s
y
, and
s
z
s_z
s
z
, are identical, the scaling is called
uniform
. Otherwise, it is
non-uniform
.
x
=
r
cos
ϕ
y
=
r
sin
ϕ
x
′
=
r
cos
(
ϕ
+
θ
)
=
r
cos
ϕ
cos
θ
−
r
sin
ϕ
sin
θ
=
x
cos
θ
−
y
sin
θ
y
′
=
r
sin
(
ϕ
+
θ
)
=
r
cos
ϕ
sin
θ
+
r
sin
ϕ
cos
θ
=
x
sin
θ
+
y
cos
θ
(
x
′
y
′
)
=
(
cos
θ
−
sin
θ
sin
θ
cos
θ
)
(
x
y
)
\begin{aligned} &\begin{aligned} x & =r \cos \phi \\ y & =r \sin \phi \\ x^{\prime} & =r \cos (\phi+\theta) \\ & =r \cos \phi \cos \theta-r \sin \phi \sin \theta \\ & =x \cos \theta-y \sin \theta \end{aligned}\\ &\begin{aligned} y^{\prime} & =r \sin (\phi+\theta) \\ & =r \cos \phi \sin \theta+r \sin \phi \cos \theta \\ & =x \sin \theta+y \cos \theta \end{aligned}\\ &\left(\begin{array}{l} x^{\prime} \\ y^{\prime} \end{array}\right)=\left(\begin{array}{cc} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{array}\right)\left(\begin{array}{l} x \\ y \end{array}\right) \end{aligned}
x
y
x
′
=
r
cos
ϕ
=
r
sin
ϕ
=
r
cos
(
ϕ
+
θ
)
=
r
cos
ϕ
cos
θ
−
r
sin
ϕ
sin
θ
=
x
cos
θ
−
y
sin
θ
y
′
=
r
sin
(
ϕ
+
θ
)
=
r
cos
ϕ
sin
θ
+
r
sin
ϕ
cos
θ
=
x
sin
θ
+
y
cos
θ
(
x
′
y
′
)
=
(
cos
θ
sin
θ
−
sin
θ
cos
θ
)
(
x
y
)
Links to this page:
Vertex Processing
Built with
Flowershow