4
$\begingroup$

In an optimization problem I have to parametrize a circular arc. Thus far, I have reduced a more general problem to the figure below:

Circular Arc

The figure shows a symmetrical circular arc, with chord length L, and the internal angle beta at both end points. The coordinate system has its origin at the left end point. The x axis points along the chord, and the y-axis upward in the image (not pictured, sorry).

I wish to find points on this arc, preferably equally spaced on the arc, but since the angle beta is low (<10° in most cases), points equally spaced on the x-axis would do.

My problem is that the angle beta can be extremely small, zero, or negative. If I were to calculate a radius, it may be extremely large, infinite or complex. I want to avoid this if possible because it would cause numerical problems.

How can I parametrize this arc without calculating the radius, and using Cartesian coordinates with an origin as described above?

I can filter the negative case out with a control structure, if necessary.

$\endgroup$
4
$\begingroup$

If you're willing to use the second-order Taylor polynomial to the circle, which is visually indistinguishable from the circle for $|\beta| < 10^{\circ}$, one numerically-stable formula is $$ y = \frac{L}{2}\, \frac{\sin \beta}{1 + \cos\beta} - \frac{\sin\beta}{L}\left(x - \frac{L}{2}\right)^{2}. $$ The diagram shows the circle making an angle of $18^{\circ}$ in blue, and the parabola superposed as a fine green curve, overshooting by about half a line width at the ends:

A shallow arc of circle and parabolic approximation


Edit: In the same vein, a numerically stable exact equation of the circle is $$ y = \frac{L}{2}\left[ \frac{\sin \beta}{1 + \cos\beta} - \frac{\bigl(1 - (2x/L)\bigr)^{2} \sin\beta}{1 + \sqrt{1 - \bigl(1 - (2x/L)\bigr)^{2} \sin^{2}\beta}} \right]. $$

$\endgroup$
  • 1
    $\begingroup$ It's an aerodynamic problem and the result may get manufactured. I think your solution would likely work, but I am not completely sure, so I will keep this open for a while longer. $\endgroup$ – RikkiTikkiTavi Nov 25 '15 at 10:59
  • $\begingroup$ I am thinking about using the circle center for all cases >2°, and the taylor polynomial for the smaller angles. The jump between the two solutions should be minuscule that way. With luck, it won't trip up the numerical optimization. $\endgroup$ – RikkiTikkiTavi Nov 25 '15 at 14:01
  • $\begingroup$ Regarding the edit: Sweet! Do you have a source? $\endgroup$ – RikkiTikkiTavi Nov 25 '15 at 14:17
  • 1
    $\begingroup$ Just my own computations; it would be a little surprising if the result weren't "well-known", however. $\endgroup$ – Andrew D. Hwang Nov 25 '15 at 14:26
  • $\begingroup$ I've become unsure if this is correct. Particularly, I am concerned that the angles at the ends don't match. I would expect to get dy/dx=+-tan(beta), but for the Taylor I get dy/dx=+-sin(beta). Do I misunderstand something? $\endgroup$ – RikkiTikkiTavi Dec 1 '15 at 17:05
2
$\begingroup$

Andrew's answer is correct and very applicable. Going forward, I have stumbled upon annother solution, that is both non-recursive and provides points equally spaced along the chord. I thought this was worth mentioning here, for google to find.

Robert Schaback wrote a paper titled "Planar Curve Interpolation by Piecewise Conics or Arbitrary Type" (available here; only section 2 is directly relevant), in which he details a method to interpolate between three points using arbitrary conics given the slopes at the two outer points. This interpolation is, as Schaback proves, unique, so only one conic fits the data.

Since a circle is a special case of a conic, and we can produce enough information to apply Schaback's method to match a circle, we know that the result must be a circle. We already know the slopes ($\tan(\beta)$ and $\tan(-\beta)$) as well as the starting and end points. All that is now required is a point on the arc, and that is easily obtained by calculating the position of the arc's apex. The x position is half the length between the end points, and the height can be calculated from the well-known equations of circular arcs.

$$ h=\frac{L}{2}\,\frac{1-\cos(\beta)}{\sin(\beta)} $$

$\endgroup$
  • 1
    $\begingroup$ Look up so-called "bulge factor" representations of circular arcs and conics. If I remember rightly, there are papers by Malcolm Sabin, Gossling, and others. $\endgroup$ – bubba Apr 4 '16 at 14:48
  • 1
    $\begingroup$ Or a rational quadratic Bezier curve would work, too. $\endgroup$ – bubba Apr 4 '16 at 14:49
  • $\begingroup$ @bubba Yes, as I now know more about curves in general, I have come to understand that the paper I linked constructs a rational quadratic Bezier curve. I have implemented this and it works very well. Andrew's answer is great, too. $\endgroup$ – RikkiTikkiTavi Apr 4 '16 at 16:51

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.