[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: gEDA-user: pcb GL can't render stretched arcs
Andrew Poelstra:
> I am using the polar form of the ellipse given at:
>
> http://en.wikipedia.org/wiki/Ellipse#Polar_form_relative_to_center
>
> with theta the angle of the point we are checking. (Those cos
> and sin calculations are easy, just delta-x/len and delta-y/len.)
> With that I can calculate the distance from the point to an
> ellipse.
The shortest line from (x,y) to the ellipse goes through the normal to
the ellipses perimeter.
The normal does not generally go through the middlepoint of the ellipse.
It crosses the line between the center and the nearest focal point.
What you get with the above polar calculation is a little bigger value
than the true distance, but it could serve as a first aproximation.
You could take the minimum of the polar form through the center and
through the focus, to get a better value.
How accurate an value do we need, would minimum of ±5% and ±0.1mm
be ok ?
> 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.
...
Isn't that a bug to be fixed instead?
Regards,
/Karl Hammar
-----------------------------------------------------------------------
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57
_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user