Qubyte Codes

A Battenberg in SVG


In celebration of the Battenberg theme, here is an animated Battenberg! It's made of two SVG paths composed of lines and arcs. These are calculated using three angles and a bucket load of trigonometry (I'm not as good as I used to be at trig). A requestAnimationFrame loop updates these angles and the paths. Click on start to begin the animation. You can tweak the angular speeds using the three number inputs.

There are better ways to do this. I chose SVG to challenge myself!