2011/7/16 Andrew Poelstra <as...@sfu.ca>: > There is a fairly informative discussion of this problem on SO: > http://stackoverflow.com/questions/2945337/how-to-detect-if-an-ellipse-intersectscollides-with-a-circle
I had a look and found one algebraic solution close to the one I have proposed. > The correct methods given there generally require root-solvers, Why is the algebraic solution not correct? > Since we rarely care about the exact distance, only "is it between > 0 and Radius" it is probable that we could use a bisection method > with very few iterations to get an answer. I am convinced we do not need any iterations or equation solvers. We just need to check with the transformed point coordinates in the equations for the two arcs where one is the inner arc and the other is the outer arc where the point radius has been subtrcacted respectively added to the arc lenghts(width, height). If the point intersects the equation for the inner arc is <= 0 and the equation for the outer arc is >= 0 and since it is not a complete ellipse one need to check that the angle between point and arc centerpoint is within the arcs limiting angles which is not to difficult if the limiting angles are known. >> > Restricting this to an ellipse /segment/ is tricky, since as DJ >> > pointed out, these are not "real" elliptical arcs, but stretched >> > arcs, so the limiting angles do not correspond directly to actual >> > angles. This is the true problem, if the limiting angles are not know then the problem is unsolvable but I assume there is a way of finding what the real limiting angles are. I have not looked into how they become stretched but there must be a systematic way the stretch transforms the arc. >> >> Isn't that a bug to be fixed instead? >> > > It's a design flaw, but "fixing" it would break existing designs. Well, one could still keep the (wrong when stretched) limiting angles and add new paramters to the struct for real angles. Now I also assume from looking at DJ's stretched arc that the axis length along the not stretched direction must also be recalculated. I'll be back. > > -- > Andrew Poelstra > Email: asp11 at sfu.ca OR apoelstra at wpsoftware.net > Web: http://www.wpsoftware.net/andrew/ > > > > _______________________________________________ > geda-user mailing list > geda-user@moria.seul.org > http://www.seul.org/cgi-bin/mailman/listinfo/geda-user > _______________________________________________ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user