CSE5280 Computer Graphics

Chapter #5 Solutions

 

5-2 Show that the composition of 2 rotations is additive by concatenating the matrix representations for R(theta1) and R(theta2) to obtain ==> R(theta1) . R(theta2) = R(theta1 + theta2)

answer: This equation can be validated by evaluating both sides using a matrix representation
from either Section 5-2 or Section 5-11.

5-4 Prove that the multiplication of transformation matrices for each of the following sequences is commutative:
a) 2 successive rotations

ans: Using the trigonometric identities for the sine and cosine of the sum of two angles,
we can express the elements of the product matrix for two successive rotations in the xy
plane about the coordinate origin as

Since the addition of angles is commutative, this composite transformation is commutative.
The commutative property of two successive rotations can also be shown by comparing
the elements of the composite matrix R1 R2 with the elements of the composite
matrix R2 R1.

b) 2 successive translations

The composite matrix for two successive translations is given by Eq. 5-28 (page 241) . And
this matrix product is commutative because the addition of the translation parameters
is commutative.

c) 2 successive scalings

The composite matrix for two successive scaling transformations is given by Eq. 5-33 (page242) .
This is also a commutative matrix product because the product of the scaling parameters
is commutative.

 

5-5 Prove that a uniform scaling and a rotation form a commutative pair of operations but that, in general, scaling and rotation are not commutative operations.

ans: The matrix representation for a two-dimensional transformation sequence consisting of
scaling followed by rotation, relative to the coordinate origin, is

And the matrix representation for a rotation followed by scaling, relative to the coordinate
origin, is

These two matrices are equivalent only when sx = sy.

5-12 Show that 2 successive reflections about either the x-axis or the y-axis is equivalent to a single rotation in the xy plane about the coordinate origin.

ans: Two successive reflections about a single axis yields the identity matrix; i.e., the object is
returned to its original position. A reflection about one axis followed by a reflection about
the other axis is equivalent to a rotation of 180°, assuming that the reflection parameters
are either 1 or -1.

5-13 Determine the form of the two-dimensional transformation matrix for a reflection about any line: y = mx + b.

ans: A transformation sequence for obtaining the composite matrix for reflection about a given
line is:
(1) Translate the line so that it passes through the coordinate origin. Since parameter
b is the value for the y-axis intersection, the translation parameters are tx = 0 and
ty = −b.
(2) Rotate the line onto the x axis. A horizontal line is already on the x axis, and
a vertical line is perpendicular to the x axis (a 90° angle). Otherwise the angle
between the reflection line and the positive x axis is calculated from the slope of the
line: Ø = tan-1 m

If this angle is positive (m > 0), perform a clockwise rotation with respect to the
coordinate origin. If the angle is negative (m < 0), perform a counterclockwise
rotation with respect to the coordinate origin. Thus, in either case, set θ = −θ and
use the transformation matrix for a counterclockwise rotation.

(3) Perform the reflection about the x axis using transformation matrix 5-52.


(4) Carry out the inverse of steps (2) and (1) to return the line to its original position.
Multiplying these five transformation matrices and simplifying the trigonometric expressions
using double-angle formulas, we obtain the transformation matrix for reflection
about the line y = mx+ b as

In this matrix, angle θ is the negative of the line angle with respect to the x axis, as
calculated in step (2).

5-17 Setup a shearing proceedure to display two-dimensional italic characters, given a vector font definition. That is, all character shapes in this font are defined with straight line-segments, and italic characters are formed with shearing transformations. Determine an appropriate value for hte shear parameter by comparing italics and plain text in some available font. Define a simple vector font for input to your routine.

ans: Given a set of character definitions and a required shearing amount, we can apply matrix
5-59 on page 256 to each character to shear it relative to its baseline before displaying the character.