Re: Creating a full circle with one arc command

On Thu, May 24, 2018 at 1:03 PM, Liam R. E. Quin <liam@w3.org> wrote:
> In the meantime note that if the end point is very very close to the
> start point, you can get an almost-circle:
>   <path d = "M 20 200 A 75 75 360 1 1 20 200.00001 z"/>
> draws a circle in one implementation i tried, and
> <path d = "M 20 200 A 75 75 360 1 1 20 200.00001 z"/>
> but
> <path d = "M 20 200 A 75 75 360 1 1 20 200.000005 z"/>
> does not.
> However, in another implementation neither of these produced a circle,
> but 0.01 did. Almost. It turns out SVG mandates "at least" single
> precision floats, but allows higher.

I wouldn't recommend doing that.  In addition to the rounding issues
you've already found, both points have to lie on the circle, and when
they're that close together a very tiny perturbation can have a large
visible effect on the orientation of the circle.

The most stable way to do a full circle is with two half-circle arcs,
because it's maximally resistant to such perturbations, and quite easy
to compute where the endpoint should go without trig.

~TJ

Received on Thursday, 24 May 2018 20:26:11 UTC