Vectors have proven to be useful wherever circles are involved, so I wrote myself a library to avoid rewriting code for every project. It includes functions for adding, subtracting, scaling and normalizing vectors. You can find the source code HERE.
I used Jasmine to test my functions. Click HERE to see my specs.
Click HERE to see the Jasmine Spec Runner in action.
Got Jasmine set up thanks to THIS well-written tutorial.
Get the latest Jasmine version HERE.
1. Basics of the Jasmine testing framework
2. Re-learned how to find the dot product of two vectors. Yaay!
1. Use the Jasmine beforeEach, afterEach functions
2. Test asynchronous data