d3 / d3-voronoi

Compute the Voronoi diagram of a set of two-dimensional points.
Other
249 stars 60 forks source link

Suggestion: small optimization by returning the tangent instead of the angle #15

Closed Fil closed 8 years ago

Fil commented 8 years ago

https://github.com/d3/d3-voronoi/blob/master/src/Cell.js#L16 uses Math.atan2to give us the angle, but the result is only ever used to compare angles, so we could return the tangent instead.

Fil commented 8 years ago

I tried to play with this idea and I am stump, so let's just forget about this