Wednesday, July 1, 2015

Computer Graphics : Bresenham's Midpoint Circle Algorithm


Theory for the algorithm

That's some good basic theory there, like how it is taught in class. For detailed theory, check your class notes :P ... I am sure the topic is taught.

And using this theory, you can code very easily based on the formulae.

And use the formula only to plot one octant of the circle. And then using mirror image logic - symmetry logic , you can find other pints for the other octants. See the above link.

Actually, I never knew about this octant stuff and mistook it as quadrant, since I didn't attend the class or check the above theory properly and you should see the output I got, based on 'quadrant' theory and symmetry plotting :


Now, that's some bad circle due to some crazy math which I am yet to check out (Care to help me ?)

So, use the octant theory and the actual output should look something like the below. And you can actually click the images to see them in full size. Don't mind the cross...I put it to check the accuracy and stuff...looks like a sniper view in a shooting game, doesn't it ? :P Mail me if you have problems understanding this theory :)



No comments:

Post a Comment

Note: Only a member of this blog may post a comment.