tag:blogger.com,1999:blog-7689707394670942532.post2899387745383244584..comments2016-11-19T05:05:52.866-08:00Comments on Hans Muller's Flex Blog: Approximating a Circular Arc With a Cubic Bezier PathHans Mullerhttp://www.blogger.com/profile/13225910609140131153noreply@blogger.comBlogger13125tag:blogger.com,1999:blog-7689707394670942532.post-63859642983233572242016-10-20T22:13:35.966-07:002016-10-20T22:13:35.966-07:00With width and height = 300, radius = 100, beginan...With width and height = 300, radius = 100, beginangle=0 and endangle=90 the output is <br />M :250, 150<br />C 250, 156.929 248.608, 167.832 246.891, 174.74<br /><br />If you see the end point is really close to beginning point.<br /><br />Can some one please reply, what I am missing here.Jayanth a shttp://www.blogger.com/profile/13309098692640768105noreply@blogger.comtag:blogger.com,1999:blog-7689707394670942532.post-41214300258988334422016-10-20T20:16:15.427-07:002016-10-20T20:16:15.427-07:00In the code shared, createSmallArc what is the pur...In the code shared, createSmallArc what is the purpose of a = (a2 - a1) / 2.0; division by 2?<br /><br />Also in createArc why are we normalizing the angles (dividing by 2pi)?Jayanth a shttp://www.blogger.com/profile/13309098692640768105noreply@blogger.comtag:blogger.com,1999:blog-7689707394670942532.post-40687768234773396682016-10-20T07:46:16.218-07:002016-10-20T07:46:16.218-07:00The arc's x1,y2 and x4,y4 end points - should ...The arc's x1,y2 and x4,y4 end points - should actually be x1, y1 and x4, y4. I think its a typo.Jayanth a shttp://www.blogger.com/profile/13309098692640768105noreply@blogger.comtag:blogger.com,1999:blog-7689707394670942532.post-16722915383185530082015-07-06T23:08:55.236-07:002015-07-06T23:08:55.236-07:00Googling around I found the solution for approxima...Googling around I found the solution for approximating an elliptical arc with a cubic Bezier path at http://www.spaceroots.org/documents/ellipse/node22.html. The gist is as follows:<br /><br />The parametric equations of an ellipse are x = a * cos(t) and y = b * sin(t) or<br />f(t) = (a * cos(t), b * sin(t)) <br />The tangent line is simply the first derivative of f with respect to t or<br />f′(t) = (-a * sin(t), b * cos(t))<br />So the control points for an elliptical arc starting at parametric angle s and ending at parametric angle e are<br />c(s) = f(s) + alpha * f′(s)<br />c(e) = f(e) - alpha * f′(e)<br />where alpha is a scaler computed by<br />delta = e - s; // the arc's parametric subtended angle<br />tand = tan(delta / 2); // tangent of half the angle used below<br />alpha = sin(delta) * (sqrt(4 + 3*tand*tand) - 1) / 3;<br /><br />As with previous solutions, arcs greater than 90° need to be segmented. This solution requires no rotation. If large arcs are equally segmented, then the same alpha applies to all segments. Humans rarely specify s and e using parametric arcs measures so typical arcs measures need to be converted to their parametric equivalents.<br /><br />I have a Javascript implementation at http://jsfiddle.net/blyon/jyb45uxt/Bobhttp://www.blogger.com/profile/10774678236447988748noreply@blogger.comtag:blogger.com,1999:blog-7689707394670942532.post-47802634461698651622015-05-29T19:53:08.271-07:002015-05-29T19:53:08.271-07:00Thanks! It works perfectly.Thanks! It works perfectly.Bobhttp://www.blogger.com/profile/10774678236447988748noreply@blogger.comtag:blogger.com,1999:blog-7689707394670942532.post-58062073427722851122015-05-29T19:52:27.026-07:002015-05-29T19:52:27.026-07:00Thanks for the information, and a HUGE thanks to e...Thanks for the information, and a HUGE thanks to eugene-gff for providing the correct computation for the tangents. My demo code can be found at http://jsfiddle.net/blyon/4toxqjro/Bobhttp://www.blogger.com/profile/10774678236447988748noreply@blogger.comtag:blogger.com,1999:blog-7689707394670942532.post-32465699125617194022014-04-24T13:42:27.335-07:002014-04-24T13:42:27.335-07:00Would it be possible to calculate the maximum devi...Would it be possible to calculate the maximum deviation between this curve and a true radiused arc through 90 degrees? Would the location of this maximum deviation be at 30 degrees off one end (assuming a 90 degree arc)?Rob Fogelsonghttp://www.blogger.com/profile/17747431997596054583noreply@blogger.comtag:blogger.com,1999:blog-7689707394670942532.post-90599007178847572462014-02-17T02:57:06.001-08:002014-02-17T02:57:06.001-08:00Hi,
What platform do i need to check and use this...Hi,<br /> What platform do i need to check and use this method?<br />I've been using pro-engineer to create bezier from equations.<br />I calculated the control points manually and tested in pro-e but the curve is nowhere near a circular arc.<br /><br />I have been trying to construct a circular arc using cubic Bezier. I referred a research article written by RISKUS A. in 2006. If the circle center point is at (o,o) it gives an arc approximation. But when i want to plot an arc using cubic bezier on an arbitrary center then it does not work.<br /><br />My bezier is formed somewhere else only.<br /><br />I tried all three of his methods using kappa 'K' and 'K2". Although values of both come to same only.<br /><br />Please guide.<br />HNFhttp://www.blogger.com/profile/04235713422222200782noreply@blogger.comtag:blogger.com,1999:blog-7689707394670942532.post-77323564702382118692012-09-14T08:10:26.238-07:002012-09-14T08:10:26.238-07:00[quote]The derivation of the control points for an...[quote]The derivation of the control points for an arc of less than 90 degrees is a little more complicated. If the arc is centered around the X axis, then the length of the tangent line is r * tan(a/2), instead of just r. The magnitude of the vector from each arc endpoint to its control point is k * r * tan(a/2).[/quote]<br /><br />It`s wrong as if a = 90 degrees formula is not reduced to well known case. Actually magnitude is equal to k1 * r, where k1 = 4/3 * (1 - cos(a/2)) / sin(a/2), for a = 90 it reduced to 4/3 * (sqrt(2) - 1).eugene-gffhttp://eugene-gff.livejournal.com/noreply@blogger.comtag:blogger.com,1999:blog-7689707394670942532.post-18784792322891416622011-10-19T11:54:05.495-07:002011-10-19T11:54:05.495-07:00I've written an update to the material present...I've written an update to the material presented here, it's "More About Approximating Circular Arcs With a Cubic Bezier Path" - http://hansmuller-flex.blogspot.com/2011/10/more-about-approximating-circular-arcs.html.Hans Mullerhttp://www.blogger.com/profile/13225910609140131153noreply@blogger.comtag:blogger.com,1999:blog-7689707394670942532.post-22803844185964383172011-10-12T11:16:10.038-07:002011-10-12T11:16:10.038-07:00Sorry about the "view source" failure, I...Sorry about the "view source" failure, I'll have to sort out how to make that work. There are two links to the CircularArc.mxml in the text, it's:<br />https://sites.google.com/site/hansmuller/flex-blog/CircularArc.mxmlHans Mullerhttp://www.blogger.com/profile/13225910609140131153noreply@blogger.comtag:blogger.com,1999:blog-7689707394670942532.post-42897468460012192342011-09-20T17:55:27.086-07:002011-09-20T17:55:27.086-07:00This looks like exactly what I need. Unfortunately...This looks like exactly what I need. Unfortunately, the "View Source" command does not take me to a page. I would be very grateful if you were able to fix that. Thanks much.TrentBrownhttp://www.blogger.com/profile/00547112894820809848noreply@blogger.comtag:blogger.com,1999:blog-7689707394670942532.post-73903266409081238202011-04-12T14:52:27.421-07:002011-04-12T14:52:27.421-07:00Very interesting implementation. Nicely illustrate...Very interesting implementation. Nicely illustrated effect showing the control points.<br /><br />Thanks for sharing.<br /><br />Alex Kiriakozighttp://www.blogger.com/profile/13135977588451388108noreply@blogger.com