hadley/ggplot2 — pull request #614 by wch (2012-07-09 04:56:38+00:00)
Title: Use spiral arc length for polar distance calculation

Fixes #471.

This code fixes `coord_distance.polar` to give correct lengths. It could be cleaned up a bit, and it could also use some tests.

The following code generates [this PDF](https://dl.dropbox.com/u/84377/spiraltest.pdf):

```
# 80 concentric circles
df <- data.frame(x = 0:1, y=rep(c(1:80), each=2))
ggplot(df, aes(x=x, y=y, group=factor(y))) + geom_line() + coord_polar()
```

It's somewhat of an improvement over the current method, [shown here](https://dl.dropbox.com/u/84377/spiral_orig.pdf).

The resolution toward the center still isn't high enough, in my opinion. As I mentioned in #471, there's often a greater information density (and therefore sharper turns) toward the center of the circle, and so it would be useful to have higher resolution toward the center.