Graphics Reference
In-Depth Information
where
is the angle that is rotated in the counterclockwise direction measured
with respect to the origin. As in the case for translation and scaling, we represent
the rotation operation as
θ
V ar =(2.83,8.49)
V ar =
V a R
( θ )=
V a R
.
C a
R(45 o )
45 ,or
Figure 8.12 shows an example where the rotation angle
θ =
V a =(8,4)
45 ) ,
45 o
R
( θ )=
R
(
R a
operating on V a :
V a = x a y a = 84
Figure 8.12.
The rotate
operator.
and turning the point to the new position V ar at
V ar = x ar y ar
=
( θ )
= x a cos
V a R
θ
θ
y a sin
θ
y a cos
θ +
x a sin
= 8cos
)
(
45
)
4sin
(
45
)
4cos
(
45
)+
8sin
(
45
2
49 .
.
83 8
.
Notice that unlike translation and scaling operators, in the case of rotation oper-
ator, both the input x -and y -coordinate values affect the x -and y -coordinates of
the output point. From Figure 8.12, we can see that the rotation operator turns V a
counterclockwise 45 degrees. This turning is performed with respect to the origin
(
0
,
0
)
such that R a , the distance between V a and the origin:
x a +
8 2
y a =
4 2
R a
=
+
9
.
0
,
is the same as R ar , the distance between V ar and the origin:
x ar +
2
y ar =
83 2
49 2
R ar =
.
+
8
.
9
.
0
.
This equidistance to the origin of input and output points of the rotation operator
is always true. When we vary the values of
, the results rotating V a will always
be located on the circumference of the circle C a in Figure 8.12. The center of this
circle is always the origin, and the radius is always equal to the distance between
V a and the origin (or R a ). In this way, the rotation operator slides input point V a on
the circumference of the circle C a . With a positive
θ
, the rotation operator slides
the input point on the circumference counterclockwise by
θ
θ
degrees, whereas a
negative
θ
will cause V a to be slid clockwise along the circumference. As in the
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Search WWH ::




Custom Search