Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

Computer Graphics Exercises [1/9]


Computer Graphics Exercises

This program draws four discs lying on a diagonal line. For all given discs, the distance to the top of the screen equals the distance to the left edge of the screen. This implies that the coordinates x and y of disc centers are identical for any given disc.

Exercise 'diagonal 1A' output image

Exercise 1:

Draw a cyan disc somewhere on a line between the blue and the green disc.

Solution

disc(210, 210, 50, /cyan);
Exercise 'diagonal 1B' output image

Exercise 2:

Draw an orange disc somewhere on a line between the red and the purple disc.

Solution

disc(470, 470, 50, /orange);

Loading...