Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!topaz!webber From: webber@topaz.RUTGERS.EDU (Webber) Newsgroups: comp.graphics Subject: Re: Algorithm needed: 2-D arc to Bezier conversion Message-ID: <8161@topaz.RUTGERS.EDU> Date: Fri, 2-Jan-87 05:18:50 EST Article-I.D.: topaz.8161 Posted: Fri Jan 2 05:18:50 1987 Date-Received: Fri, 2-Jan-87 18:35:42 EST References: <252@acornrc.UUCP> Organization: Rutgers Univ., New Brunswick, N.J. Lines: 48 Keywords: arc, Bezier, conic section Summary: approximating conics with parametric cubics In article <252@acornrc.UUCP>, bob@acornrc.UUCP (Bob Weissman) writes: > Can anyone point me to an algorithm which will provide the Bezier > polynomial for a given circular arc? > ... > Better yet, if you know of a more general conic section-to-Bezier > algorithm... actually, this is discussed in: Geometric Modeling by Michael E. Mortenson (John Wiley & Sons 1985). the basic technique is to generate a cubic that passes through an intermediate point C on the conic as well as the endpoints A and B. at the endpoints, the unit tangent of the conic and parametric cubic will also agree. as stated by an earlier respondant, using parametric cubics one can only approximate the conic, but the results here seem promising (although there is no prove that this is an optimal approximation). construction: let A and B be endpoints of the conic segment. let the tangent at A lie on the line AD and the tangent at B lie on the line BD. let E be the midpoint of the line segment AB. let F be the place where DE intersects the conic. the ratio of the length of EF to the length of DE is rho ("r" since my terminal knows no greek). if r < .5 then segment is an ellipse. if r = .5 then segment is a parabola. if r > .5 then segment is hyperbola. the basis for all of this lies in techniques used for constructing conics that fall out of what is now studied as projective geometry (an interesting reference here is: A History of The Conic Sections and Quadratic Surfaces, Julian Lowell Coolidge (Dover 1968 (Oxford 1945))). the upshot of all of this is that you approximate using the cubic that passes through the points A and B and at A has the tangent of 4 times r times the vector difference D - A and a B has the tangent of 4 times r times the vector difference of B - D. in the case of a circular arc, you let r = cos(t)/(1 + cos(t)) where t is my romanized theta denoting the angle spanned by the arc. it is a simple matter to convert the above spec for a cubic into a bezier cubic (based on the principle that anything that can be accomplished in a single matrix multiplication is "simple"). the Mortenson text is also a good ref for such conversions. enjoy. -------------------- BOB (webber@red.rutgers.edu ; seismo!topaz!webber)