Improve polygon outline performance

* Instead of `concat`ing multiply arrays then copying the result to a `Float64Array`, compute the array length up front and index into it.
* Use a scratch array when subdividing the polygon edges.
* Avoid looping over inverse trig functions.