I was writing up a tutorial and ended up making a vector library for it while explaining hit detection... https://github.com/Pryme8/Vector2 There are prolly tons of Vec2 Libs out there, but here is mine.