开发者

Plotting a polar equation with smooth appearance

I am trying to plot a polar equation in Java. Naively plotting the individual points leads to a very lumpy result. I think this is because the anti-aliasing cannot work with a graph made up of very short line segments.

There is a well known algorithm for plotting smooth XY graphs. Essentially you approximate the function with line segments. Each line segment is then subdivided recursively until it fits the curve within some tolerance. This works very well.

I tried to adapt this for polar plots by calculating the XY coordinates and using the same algorithm, but it doesn't seem to work - I suspect it is because the points are not evenly distributed in x. The line segments are too visible, but decreasing the tolerance to fit more closely results in some other parts of the c开发者_高级运维urve getting lumpy again.

Does anyone know an algorithm for plotting a polar equation smoothly?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜