The first chapter of the book focuses on setting up a foundational “tuple” library for operations on vectors and points. I didn’t really expect there to be much to show for this other than working tests. But the chapter ended with a suggestion for creating a small program to experiment with a mini physics simulation that fires projectiles at various angles and velocities and have their trajectories effected by gravity and wind.
I decided to take this a step further and create a web component that would animate the projectile on a canvas. Here it is in action:
I attempted to represent the axis by increasing/decreasing the size of the projectile. Something seems off with that though.
GitHub Copilot was helpful when writing the tuple tests. I could take the Gherkin test from the book, put it in a comment, and Copilot would generate the test code using the Gherkin-inspired test suite functions I wrote.
Onward to chapter 2!