On Sat, Apr 9, 2011 at 7:32 PM, Mathieu Bouchard matju@artengine.ca wrote:
On Sat, 9 Apr 2011, Peter Brinkmann wrote:
By the way, there's a way to draw a circle using nothing but addition:
http://en.wikipedia.org/wiki/Midpoint_circle_algorithm Implementing this in Pd is completely impractical, but it's fun to think about.
It's not strictly the same thing, because by using sin and cos, you are ensuring equal distance between points at infinite resolution, and you are ensuring equal angles everywhere too.
With the midpoint circle algorithm, instead, you are ensuring that all points are one pixel apart, when using a limited resolution. The pixels are considered one pixel apart when sharing an edge or corner. This is related to http://en.wikipedia.org/wiki/Maximum_norm
So, it depends on whether you're trying to draw something continuous-looking on a pixel display.
Sure, but in this case the goal was to draw a section of a circle in an array, and the midpoint algorithm would be a good choice if implementing it in Pd weren't so complex. Anyway, it doesn't really matter, I just like Bresenham-style algorithms. Cheers, Peter