# Lecture 4 Graphic Primitives, Circle. Drawing Circles.

• Published on
01-Apr-2015

• View
216

• Download
1

Embed Size (px)

Transcript

• Slide 1

Lecture 4 Graphic Primitives, Circle Slide 2 Drawing Circles Slide 3 Brute Force Method Slide 4 Cheating with 8 arcs Slide 5 Cheating with 8 arcs Implementation Slide 6 Slide 7 Digital Differential Analysis - An incremental algorithm Does not require sine or cosine table. based upon calculating the gradient of a circle at a point and using that to approximate the position of the next point. Slide 8 Digital Differential Analysis - An incremental algorithm Slide 9 Digital Differential Analysis - Implementation Slide 10 Bresenhams algorithm for circles Based on limiting the choice of the next pixel to be plotted to two alternatives, then creating and testing a decision variable to determine which alternative is actually plotted. D(Si) and D(Ti) represent the differences between the squared distance between the center of the circle and the middle of pixels S and T. Whichever is smallest corresponds to the pixel that should be plotted. To combine the two calculations into one decision variable is simply a matter of subtracting the two expressions: Slide 11 Bresenhams algorithm for circles Slide 12 Implementation for Bresenhams algorithm Slide 13 Implementation for circles Slide 14 Slide 15