toji/gl-matrix — pull request #7 by Coreh (2011-12-13 01:05:40+00:00)
Title: Implement vec3.dist, a method for calculating the distance between two vectors

Hey @toji,

First of all, thanks for writing gl-matrix! I really like the way it handles things. It's my favourite JS 3D math library so far.

I needed to calculate the distance between two points represented as `vec3`, and found no easy way to do so. I could of course use `.subtract` and then `.length`, but that would be slower than calculating the distance directly. Since this library is focused on speed, I figured a method for calculating distances would come in handy.

This commit adds a pretty trivial `vec3.dist` method that does exactly this. I tryied to respect the conventions used by the library, but you might want to change the name into something else.

Thanks.