1
$\begingroup$

I have an cubic bezier curve, which is representing an arc by an approximation. The approximation was calculated with the kappa constant:

$$ \\k = \frac43*(\sqrt{2}-1) $$

This means, that the distance from the end points to the control points of the bezier curve is just r*k. The information is based on the riskus paper for bezier arc approximation.

Now I am looking for a solution (analytical or numerical) to revert the approximation and calculate the originally arc.

On this article, there is described the formula calculate the magnitude of the vector from each arc endpoint to its control point, where alpha is the arc angle.

$$ \\length = k*r*tan(\frac\alpha2) $$

This formula only works if the arc is centered around the X axis. Is there an universal formula to calculate the radius or angle with the given control points using the kappa constant? Or are there some other numerical algorithms to revert the approximation?

Currently, I determine the normal vectors of the tangents (start-c1 and end-c2) and calculate the intersection point (arc center). The problem on this solution is the bad accuracy while processing big arcs caused by the radial drift of 0.027253% described here

Any suggestions?

$\endgroup$
1
$\begingroup$

The number $k$ that you cited is suitable only for circular arcs whose angular span is 90 degrees.

If you search this site, you will find several answers that tell you how to construct a cubic Bézier curve that approximates a general circular arc, whose angular span is not necessarily 90 degrees. The answer to this question is one of the best ones. In most cases (maybe even all cases), these techniques give you a Bézier curve that exactly matches the arc in position and tangent direction at the start point and end point. So, the Bézier curve gives you the position and tangent direction at the start point and end point of the circular arc. This gives you enough information to calculate its center and radius.

The "radial drift" you mentioned refers to points in the interior of the curve; there is no radial error at the end points.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.