Xref: utzoo sci.math:6998 sci.math.num-analysis:29 comp.graphics:6094 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!agate!saturn!skinner From: skinner@saturn.ucsc.edu (Robert Skinner) Newsgroups: sci.math,sci.math.num-analysis,comp.graphics Subject: Re: Computing Bezier Control Points for an Arc of a Circle Summary: here is an approximation... Keywords: bezier, arc, graphics Message-ID: <7888@saturn.ucsc.edu> Date: 9 Jun 89 16:03:11 GMT References: <108121@sun.Eng.Sun.COM> Organization: U.C. Santa Cruz, CIS/CE. Lines: 45 > > 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 > quoting from Computational Geometry for Design and Manufacturing, by Faux and Pratt, page 134: A close approximation to the circular are r = cos(t) i + sin(t) j for 0 <= t <= pi/2 is obtained by writing P0 = i, P2 = i + k*j, P3 = k*i + j and P4 = j, where k = 4(sqrt(2)-1)/3. The radius of the approximate arc varies betwen 1 and 1.00027 in this case, the maximum deviation from the mean radius being +-0.13%. (Where t = theta, r0 - r4 are the Bezier control points, and i and j are unit vectors in the x and y directions.) To generate a partial arc, you take advantage of a property of Bezier curves. If you divide each segment from P(i) to P(i+1) by some ratio, 0 <= t' <= 1, then connect those three points by two segments and divide by the same ratio, then connect the final two point and divide it by the same ratio, then the resulting point is on the curve at t = t' AND the interior points define two smaller Bezier that subdivide the original one, in the desired ratio. The end result of all this is from your original points for the quadrant curve, P you get the points for P' by this: P0' = P0 P1' = (1 - t')P0 + t*P1 P2' = (1 - t')^2*P0 + 2t(1-t')P1 + t^2 * P2 P3' = (1 - t')^3*P0 + 3t(1-t')^2*P1 + 3t^2(1-t')P2 + t^3 * P3 Note that P3' is on the curve, which is to be expected. that should do it. Robert skinner@saturn.ucsc.edu