At work I have a project with a simple LCD display. It includes a simple interface that includes rounded corners on the main menu. While it doesn't effect what I am doing I was curious what algorithm they used to round the corners. Most people use a variant the midpoint circle algorithm
, including Bill Atkinson who made the rounded rectangles used on the original Macintosh computer
. This approach was a little different. To round a corner, lines would be drawn between two points, starting with a vertical line, and then advancing finishing x point by one, and the decrementing the starting y point by one. This is an old trick I remember seeing sometime in middle school. You can do it on graph paper. By drawing only straight lines you end up with a curve. By moving only a single pixel, there are no unfilled areas and you end up with a rounded corner.
While this algorithm works, it's really inefficient. Each new line only contributes a couple of pixels and the rest simply overlap. Still, it does function. Interesting way of solving this problem though.