05-27-2021, 05:37 PM
(This post was last modified: 05-27-2021, 05:48 PM by Ottia Tuota.)
(05-27-2021, 05:24 PM)Ofnuts Wrote:Quote:The algorithm to draw circular arcs is based on the well-known idea.
Is that the one that uses kappa=(4/3)*(sqrt(2)-1) (from memory)? The shallowness of the proof of that one has always intrigued me. But it does work with all angles...
Yes that is the one. I took that very formula and with some trigonometric manipulation changed it to suit my current purpose. Namely, I was drawing circular arcs without knowing the centers. But I had tangent triangles available. The code became pleasantly simple. You can find it in the plugin. Search for "def circlular_arc_in_tangent_triangle" (yes I notice now that there is a typo!). Note that I use the plane as the complex number plane. So, instead of [x,y] all points are complex numbers x+iy.
Edit: No, I said wrong. I did not take quite that formula but a more general one that works for circular arcs with central angle other than 90 degrees. The formula is: (4/3)*tan(theta/4) where theta is the central angle.