I recently bought a special 30 days for $30 Flexipass with Vancouver Parks Board so I’ve been going to the gym and swimming! An analog clock was on my list of to-dos but I decided to make a pool clock instead. A pool clock only shows minutes and seconds. The second “hand” is accompanied by 3 other hands with only 15 seconds between them.
Describing the hands now makes it obvious how to write the script to move them! However, I got stuck on the task for a while because I overcomplicated things. I thought I had to somehow subtract a quarter of the circle and was looking at radians. What a mess!
It took me a while fumbling with the radian values before discovering that I could simply subtract increments of 15 seconds to get all 4 hands on the canvas… of course! Sometimes describing something in simple terms gives you simple directions to write the code too. Of course you also need to clear the canvas every second or else you will get something that looks like a beach ball.
Working on this clock also got me reading about Tau. I can’t believe I haven’t heard of Tau before now! Here’s some info on Khan academy and the Tau Manifesto. Tau day doesn’t quite have the same ring to it as Pi Day though… mmmm, pie….
Day 36 – Pool Clock