Java Swing - Graphics
TOPIC 03 –AFFINE TRANSFORMATIONS

 

LESSON WORK

 

 

QUESTION #1

Create a square shape (using Rectangle2D.Double).  Rotate it so that it is a diamond.

 

QUESTION #2

Create a simply arrow shape that points upwards (using Path2D.Double).  Do the following transformations:

 

a)    First, display the arrow as you created it.

b)    Display the arrow (in red) after increasing its size three times.

c)    Display the arrow (in blue) after rotating it to points downwards.

d)    Display the arrow (in green) after stretching it to make it longer.

e)    Display the arrow (in pink) after moving it in the bottom right corner of the panel.