zeke / euclidean-distance

Calculate the Euclidean distance been two points in 2D/3D/nD space.
MIT License
53 stars 10 forks source link

Idea: "squared.js" #3

Closed mattdesl closed 8 years ago

mattdesl commented 9 years ago

Often in graphics dev you only need the squared result and can avoid a sqrt operation. It might be cool to expose the following:

var distSq = require('euclidean-distance/squared')

It would also go well alongside this module: https://github.com/mattdesl/magnitude

zeke commented 8 years ago

Hi @mattdesl. Six months later, your wish is granted! For some reason I wasn't subscribed to github notifications for this repo, so I missed this issue. I just published 1.0.0 with the above-suggested squared support.