Graphics Reference
In-Depth Information
case of the translation and scaling operators, we observe that the output position
from the rotation operator only depends on the corresponding input point. As in
previous cases, this observation tells us that we can apply the rotation operator to
any number of points. Figure 8.13 shows that we can apply the same R
45 )
(
to
the point
= x c y c = 52 ,
V c
V cr =(2.12,5.95)
R(45 o
and the results of the rotation would, as expected, be
C c
V cr = x cr y cr
=
45 o
V c =(5,2)
R c
45 )
= x c cos
V c R
(
)
(
45
)
y c sin
(
45
)
y c cos
(
45
)+
x c sin
(
45
Figure 8.13. Rotate two
individual points with the
rotate operator.
= 5cos
)
(
45
)
2sin
(
45
)
2cos
(
45
)+
5sin
(
45
2
95 .
.
12 4
.
Once again, we notice that the distance between the input point V c and the origin
( R c )is
x c +
y c
R c =
5 2
2 2
=
+
5
.
4
,
which is the same as R cr , the distance between V cr and the origin:
x cr +
y cr
R cr =
V ar
2
d acr
=
.
12 2
+
4
.
95 2
Output
Points
V cr
V a
5
.
4
.
Input
Points
d ac
V c
In this way, we see that V c is slid along the circumference of circle C c counter-
clockwise by 45 degrees to V cr . Figure 8.14 shows that if we examine the distance
d ac between the two input points V a and V c ,wehave
Figure 8.14. Distance
between input points and
output points.
(
2
2
d ac
=
x a
x c
)
+(
y a
y c
)
(
2
2
=
8
5
)
+(
4
2
)
3
.
6
.
 
 
 
Search WWH ::




Custom Search