d3 / d3-shape

Graphical primitives for visualization, such as lines and areas.
https://d3js.org/d3-shape
ISC License
2.47k stars 307 forks source link

Optimize 90° rotation. #62

Closed mbostock closed 8 years ago

mbostock commented 8 years ago

This:

a -= halfPi, this._curve.point(r * Math.cos(a), r * Math.sin(a));

Could be this:

this._curve.point(r * Math.sin(a), r * -Math.cos(a));