1 Circle Drawing Algorithms Pictures snagged from

Slides:



Advertisements
Similar presentations
Circle Drawing Asst. Prof. Dr. Ahmet Sayar Kocaeli University
Advertisements

Lecture 4 Graphic Primitives, Circle. Drawing Circles.
CS 450: COMPUTER GRAPHICS DRAWING ELLIPSES AND OTHER CURVES SPRING 2015 DR. MICHAEL J. REALE.
CS 4731: Computer Graphics Lecture 20: Raster Graphics Part 1 Emmanuel Agu.
Computer Graphics 4: Bresenham Line Drawing Algorithm, Circle Drawing & Polygon Filling By:Kanwarjeet Singh.
1 King ABDUL AZIZ University Faculty Of Computing and Information Technology CS 454 Computer graphics Drawing Elementary Figures Dr. Eng. Farag Elnagahy.
CS 450: COMPUTER GRAPHICS REVIEW: DRAWING LINES AND CIRCLES SPRING 2015 DR. MICHAEL J. REALE.
+ CPCS 391 Computer Graphics 1 Instructor: Dr. Sahar Shabanah Lecture 3.
Scan conversion of Line , circle & ellipse
Larry F. Hodges (modified by Amos Johnson) 1 Design of Line, Circle & Ellipse Algorithms.
30/9/2008Lecture 21 Computer Graphics Assistant Professor Dr. Sana’a Wafa Al-Sayegh 2 nd Semester ITGD3107 University of Palestine.
Polar Coordinate System 11.3 – Polar Coordinates Used to plot and analyze equations of conics (circles, parabolas, ellipses, and hyperbolas. Another method.
2D Output Primitives Graphics packages provide basic operations (called primitive operations) to describe a scene in terms of geometric structures. The.
Raster conversion algorithms for line and circle
Output Primitives Computer Graphics.
CS5500 Computer Graphics © Chun-Fa Chang, Spring 2007 CS5500 Computer Graphics May 3, 2007.
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © Scan Conversion CS123 1 of 44Scan Conversion - 10/14/2014.
Circle Drawing algo..
Table of Contents Ellipse - Finding the Equation Recall that the two equations for the ellipse are given by... Horizontal EllipseVertical Ellipse.
CGMB214: Introduction to Computer Graphics
Chapter 9 Notes Honors Pre-Calculus.
Dr. Scott Schaefer Scan Conversion of Lines. 2/78 Displays – Cathode Ray Tube.
1 CS 430/536 Computer Graphics I Circle Drawing and Clipping Week 3, Lecture 6 David Breen, William Regli and Maxim Peysakhov Geometric and Intelligent.
Dr. S.M. Malaek Assistant: M. Younesi
WHERE TO DRAW A LINE?? Line drawing is accomplished by calculating intermediate positions along the line path between specified end points. Precise definition.
Scan Conversion Line and Circle
Computing & Information Sciences Kansas State University CIS 536/636 Introduction to Computer Graphics Lecture 6 of 41 William H. Hsu Department of Computing.
CS 450: COMPUTER GRAPHICS REVIEW: DRAWING ELLIPSES AND OTHER CURVES SPRING 2015 DR. MICHAEL J. REALE.
October 14, 2014Computer Vision Lecture 11: Image Segmentation I 1Contours How should we represent contours? A good contour representation should meet.
Larry F. Hodges 1 Design of Line and Circle Algorithms.
What is the standard form of a parabola who has a focus of ( 1,5) and a directrix of y=11.
Introduction Computer Graphics & Its application Types of computer graphics Graphic display : random Scan & Raster Scan display Frame buffer and video.
Graphics Output Primitives
Line Drawing and Generalization. Outline  overview  line drawing  circle drawing  curve drawing.
 A line segment in a scene is defined by the coordinate positions of the line end-points x y (2, 2) (7, 5)
ELLIPSE GENERATING ALGORITHMS 1. DEFINITION Ellipse is an elongated circle. Elliptical curves can be generated by modifying circle-drawing procedures.
MIDPOINT CIRCLE & ELLIPSE GENERARTING ALGORITHMS
Section 7.3 – The Ellipse Ellipse – a set of points in a plane whose distances from two fixed points is a constant.
November 18, We could solve for y in terms of x ( x 0, y 0 ) are the origin points A Simple Circle Drawing Algorithm The equation for a circle.
Fall 2004CS-321 Dr. Mark L. Hornick 1 Final Exam Monday Nov 13, 2-4pm CC-43 Bring Calculator – no laptops Note sheet Complete FAST entries before exam.
CS-321 Dr. Mark L. Hornick 1 Line Drawing Algorithms.
10/19/04© University of Wisconsin, CS559 Fall 2004 Last Time Clipping –Why we care –Sutherland-Hodgman –Cohen-Sutherland –Intuition for Liang-Barsky Homework.
Midpoint Circle Algorithm
1 CSCE 441 Lecture 2: Scan Conversion of Lines Jinxiang Chai.
Chapter 8 Part 2 Sections 8-4, 8-5, & 8-6. Section 8-4  solve for y and graph in a calculator  rotating a point (use formulas)  find the angle of rotation.
Hyperbolas. Hyperbola: a set of all points (x, y) the difference of whose distances from two distinct fixed points (foci) is a positive constant. Similar.
1 Bresenham’s Circle Algorithm Define:D(s i ) = distance of p 3 from circle D(t i ) = distance of p 2 from circle i.e.D(s i ) = (x i + 1) 2 + y i 2 – r.
Lecture 13: Raster Graphics and Scan Conversion
Instructor: Dr. Shereen Aly Taie If (P>0)
Computer Graphics : Bresenham Line Drawing Algorithm, Circle Drawing
Computer Graphics CC416 Lecture 04: Bresenham Line Algorithm & Mid-point circle algorithm Dr. Manal Helal – Fall 2014.
Write Bresenham’s algorithm for generation of line also indicate which raster locations would be chosen by Bresenham’s algorithm when scan converting.
Computer Graphics Inf4/MSc Computer Graphics Lecture 4 Line & Circle Drawing.
10/10/2006TCSS458A Isabelle Bichindaritz1 Line and Circle Drawing Algorithms.
Computer Graphics Lecture 07 Ellipse and Other Curves Taqdees A. Siddiqi
Computer Graphics Lecture 06 Circle Drawing Techniques Taqdees A. Siddiqi
Rasterization CENG 477 Introduction to Computer Graphics Slides from Steve Marschner, CS4620, 2008 Cornell University.
Parametric Equations Until now, we’ve been using x and y as variables. With parametric equations, they now become FUNCTIONS of a variable t.
Primitive graphic objects
Parametric equations Parametric equation: x and y expressed in terms of a parameter t, for example, A curve can be described by parametric equations x=x(t),
Lecture 31 – Conic Sections
CS 4731: Computer Graphics Lecture 20: Raster Graphics Part 1
Lecture 05: Mid-point Ellipse algorithm Dr. Manal Helal – Fall 2014
Chapter Three Part I Output Primitives CS 380.
Scan Conversion of Lines
Scan Conversion of Circles
Ellipse Fitting COMP 4900C Winter 2008.
Line Drawing Algorithms
Chapter 3 Graphics Output Primitives
Presentation transcript:

1 Circle Drawing Algorithms Pictures snagged from

2 Drawing Circles and Arcs Similar to line drawing In that you have to determine what pixels to activate But non-linear Simple equation implementation Optimized

CS-321 Dr. Mark L. Hornick 3 Cartesian form of Circle Equations (x c, y c ) r Not a very good method. Why?

CS-321 Dr. Mark L. Hornick 4 Be the algorithm!

CS-321 Dr. Mark L. Hornick 5 What does it do?

CS-321 Dr. Mark L. Hornick 6 Polar Coordinate Form (x, y) r Simple method: plot directly from parametric equations θ

CS-321 Dr. Mark L. Hornick 7 Trig functions are expensive Plots of first 1, 3, 5, 7, 9, 11, and 13 terms in the Taylor’s series for sin

CS-321 Dr. Mark L. Hornick 8 Polygon Approximation (x i, y i ) Calculate polygon vertices from polar equation; connect with line algorithm

CS-321 Dr. Mark L. Hornick 9 The Bresenham Algorithms Bresenham, J. E. Algorithm for computer control of a digital plotter, IBM Systems Journal, 4(1), 1965, pp Bresenham, J. E. A linear algorithm for incremental digital display of circular arcs. Communications of the ACM, 20(2), 1977, pp

CS-321 Dr. Mark L. Hornick 10 Bresenham’s Midpoint Circle Algorithm 0<|m|<1 in this region

CS-321 Dr. Mark L. Hornick 11 The Circle Decision Parameter Calculate f circle for point midway between candidate pixels xkxk ykyk If p k < 0: If p k >= 0:

CS-321 Dr. Mark L. Hornick 12 Calculating p k+1

CS-321 Dr. Mark L. Hornick 13 Recurrence Relation for p k

CS-321 Dr. Mark L. Hornick 14 One Last Term … If y k+1 = y k, then: If y k+1 = y k -1, then:

CS-321 Dr. Mark L. Hornick 15 Initial Values

CS-321 Dr. Mark L. Hornick 16 Bresenham Midpoint Circle Algorithm Summary At each point: If p k < 0: If p k >= 0:

CS-321 Dr. Mark L. Hornick 17 Circle Example r = 7

CS-321 Dr. Mark L. Hornick 18 Symmetry Optimization (a, b) (b, a) (a, -b) (b, -a) (-b, a) (-b, -a) (-a, b) (-a, -b) Calculate points for one octant; replicate in other seven

CS-321 Dr. Mark L. Hornick 19 General Ellipse Equation In general, ellipse described by constant sum of distances from foci Difficult to solve equations and plot points (use parametric polar form?)

CS-321 Dr. Mark L. Hornick 20 Special Case Ellipses (x c, y c ) rxrx ryry Modified midpoint algorithm possible

CS-321 Dr. Mark L. Hornick 21 Drawing Ellipses General ellipses Polygon approximation Rotation (we’ll defer this until later, when we cover coordinate transformations) Aligned axes Constrained (no rotation) Midpoint algorithm