Xref: utzoo sci.math:6983 sci.math.num-analysis:28 comp.graphics:6079 Path: utzoo!attcan!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!mcvax!kth!sunic!skakke!raadgrid.uio.no!knutm From: knutm@raadgrid.uio.no (Knut Moerken) Newsgroups: sci.math,sci.math.num-analysis,comp.graphics Subject: Re: Computing Bezier Control Points for an Arc of a Circle Keywords: bezier, arc, graphics Message-ID: <1870@skakke.uio.no> Date: 6 Jun 89 15:03:48 GMT References: <108121@sun.Eng.Sun.COM> Sender: news@skakke.uio.no Lines: 64 In article <108121@sun.Eng.Sun.COM>, stephenj@deblil.Sun.COM (Stephen Johnson) writes: > > > How do you compute the control points for a fourth order (third > degree) Bezier if the user gives you the following data: > > x, y - center of circle > rad - radius of circle > ang1 - starting angle for arc > ang2 - ending angle for arc > > Once you have the control points, its a simple task to render the > Bezier. So, how do you compute the control points? Can it be done > exactly for any angle between 0 and 360? > > --------------------------+-------------------------------------------------- > Stephen P. Johnson | Some Disclaimer and such stating the company > Sun Microsystems, Inc. | I work for knows absoutely nothing about what I > 2550 Garcia Ave., | really do. Let us for simplicity assume that the radius is one and that ang1=0 and a=ang2. To get back to the general case just requires multiplication of the Bezier coefficients by the radius and a suitable rotation. A good solution to the problem is provided by the four Bezier coefficients P0=[1,0], P1=[1,0] + L*[0,1], P2=[cos(a),sin(a)] - L*[-sin(a),cos(a)], P3=[cos(a),sin(a)], where L=(4/3)*tan(a/4). This approximation always lies outside the circle, so the error can be roughly halved by scaling the approximation appropriately. In either case the error is O(a^6) for reasonably small angles a. (The error is approximately 10^(-3) for a=90 degrees.) When the angle approaches 360 degrees the error goes to infinity. Note also that by piecing together several Bezier segments of this type, one obtains a curvature continuous spline. For angles greater than 90 or 180 degrees it is therefore adviceable to use more than one Bezier segment. All the claims made here are proved in the paper Near best approximation of circles by curvature continuous Bezier curves by Tor Dokken, Morten Daehlen, Tom Lyche and Knut Morken. This is currently only a draft, but will in its final form be submitted for publication in C(omputer) A(ided) G(eometric) D(esign) in the proceedings of a conference held at Oberwolfach in April (Surfaces in CAGD'89 ???). Knut Morken Institutt for informatikk University of Oslo P.O Box 1080 Blindern 0316 Oslo 3 Norway