UPDATE 04/24/12: a little more robust (and “mildly” documented) version has been on github for a while, just forgot to update this post. Here’s the link: https://github.com/moagrius/Point/blob/master/Point.js. I have a *really* sugary-y version as well I’m considering posting, but haven’t had the time to debug as thoroughly as I’d like. Feel free to comment if you’d like to volunteer.

UPDATE 09/01/11: added 2 more sugar methods: .degreesTo, which gives back degrees from calling instance to another point, and .orbit, to obtain a position from passed distances and degrees.

port from the AS3 Point Class. Obviously, JS doesn’t have getters/setters so the .length property had to become a method. Also added two sugar methods, just adding .distance and .interpolate as instance methods (AS3 just has them as static methods that take two Points as arguments – the instance methods function the same way but take a single “other” Point instead of two distinct Point instances).

Param names, variables names, etc are the same as shown in the livedocs link above.