Bresenham's circle algorithm

Circles have the property of being highly symmetrical, which is handy when it comes to drawing them on a display screen. Consider the diagram below: |y | \\ ..... / . | . . \\ | / . . \\|/ . \--.---+---.-- . /|\\ . x . / | \\ . . | . / ..... \\ | | ```(This diagram is supposed to be a circle, try viewing it in 50 line mode). [Read More]

Line Drawing Algorithms

Line Algorithm The basic algorithm works for lines which look like this: o------- | p1 -------- | deltaY ------- p2 | -------o | ---------------------------------- deltaX where p1 = (x1,y1), p2 = (x2, y2), x and y are both increasing from p1 to p2, deltaX = x2 - x1, deltaY = y2 - y1 and deltaX >= deltay. All other types of lines can be derived from this type. I’ll get to this bit later. [Read More]

Routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without making use of any floating point computations at all.

Problem Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without making use of any floating point computations at all. Solution Let (x ^ 2 + y ^2 = r ^ 2)……………………………..1 The basic idea is to draw one quadrant and replicate it to other four quadrants. Assuming the center is given as (a,b) and radius as r units, then start X from (a+r) down to (a) and start Y from (b) up to (b+r). [Read More]