On 07/14/2011 11:23 PM, Andrew Poelstra wrote:
On Thu, Jul 14, 2011 at 08:50:10AM +0200, Igor Lopez wrote:
Check if point px,py is on rotaded elliptic arc:
1) Translate point to use ellipse center as origin,
Px = px-x
Py = py-y
2) Insert Px, Py in Eq1
lval equal 0 -> point is exactly on arc
lval above zero -> point is inside arc
lval below zero -> point is outside arc
The problem here is that the elliptical arc has nonzero
thickness (usually, if it is a drawn solder arc). So I
actually need to see if the point is /within a certain
radius/ of the arc.
For that I need the distance from the point to the arc,
or to draw a circle around the point and check if that
intersects the arc.
To do either one analytically looks like a 4th order
equation must be solved. So I am looking for cheap
iterative solutions, or approximations, instead.
If the point is within the arc's bounding box, transform the point's
global coordinates into the arc's local (x: major axis, y: minor axis)
coordinates. Then the distance calculation is a no-brainer.
-Ethan
_______________________________________________
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user