FS#2497 - Draw > Circle > 3 Tangents (CT3) fails in some cases with 3 circles
Andrew,
See attachment with example:
Solution included on layer ‘Solution’.
Regards,
CVH
Andrew,
See attachment with example:
Solution included on layer ‘Solution’.
Regards,
CVH
This is a complex problem. QCAD uses the Apollonius algorithm and an alternative algorithm to come up with as many solutions as possible. However, it is a best effort type algorithm. There are very likely other scenarios where not all solution can be found (hence "no solution found").
There is but one solution inside the area of interest and its mirror.
Both their centers are on the Centerline.
There are indeed four more outside area of interest.
I am coding the locus of equidistant points between:
- 2 Points ⇒ RXline (Too easy )
- Point vs Line segment ⇒ Up to 4 shapes (2 Quadratic RSpline's, 2RRay's)
- Point vs Arc segment ... Circle ⇒ ... Includes Hyperbola and former
- 2 Line segments ⇒ Up to 6 shapes (2 RLine's, 2 Quadratic RSpline's, 2RRay's)
- 2 Arc segments ... Circles ⇒ ... Includes Hyperbola and former
Work in process, the hyperbola is fairly good approximated by a cubic RSpline.
Fairly good but I store the coefficients of the implicit conic equation.
Regards,
CVH
Reviewing Apollonius.getSolutionsCCC
I read: special case: at least two circles are concentric: no solution:
When two circles are concentric there are an infinite amount of circles with radius rx=abs(r1-r2)/2 tangent to both.
The locus of the center points is itself a circle with r1+(r1-r2)/2.
All intersections of the locus and circles with radius r3-rx or r3+rx are solutions for centers of tangent circles with radius rx.
Simply a question to enhance Apollonius.getSolutionsCCC
If all three are concentric with different radii then there is no solution.
If 2 of them have the same radii then there are infinite solutions.
Regards,
CVH
Andrew,
I replaced in Apollonius.getSolutionsCCC:
With the code below with good and stable results.
Newer art see PM Sat Nov 04, 2023 9:41 am
Avoid negative radii for intersections of locus/circle:
Regards,
CVH