February 2019
Intermediate to advanced
292 pages
6h 55m
English
Here’s a program for you to write. Picture an analog clock. There are (typically) twelve positions around the edge, representing the hours. Got it? Okay. Your challenge is to write a program that uses a rotation matrix to compute the positions of those hours on the clock face, and draw a pixel onto a canvas for each of them. The result ought to look something like this:

Here are four hints to get you started. (Feel free to stop reading now if you want to see if you can make it work with no hints at all!)
First, assume the clock is centered at the origin, point(0,0,0). Let the origin be in the middle of your canvas. ...
Read now
Unlock full access