Day 36 – Pool Clock

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!

complicated

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.
handsWorking 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….

clock

Day 36 – Pool Clock

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s