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?
精彩评论