[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: pcb GL can't render stretched arcs



Andrew Poelstra:
> On Thu, Jul 14, 2011 at 08:29:53PM +0200, Karl Hammar wrote:
...
> > Why not just give a warning if width and height is not equal, saying
> > that we don't really support ellipses for the moment, and be done with
> > it.
> I could, I suppose, but as you mentioned in another post, there
> are muddled physical units. As that is what I am trying to fix,
> I need to make changes anyway.

Ok.

> It would be nice if we could at least support the featureset of
> our file format, while I'm at it.

I found in [1]:

Given an ellipse:

 x^2 / a^2 + y^2 / b^2 = 1

 where
  a = greater semiaxis
  b = lesser  semiaxis
  a >= b > 0
  e = sqrt( a^2 + b^2 ) = linear excentricity = focalpoint semidistance
  epsilon = e / a = numerical excentricity


The equation of the normal to the ellipse:

 y - y1 = mn * (x - x1),   where mn = (a*a * y1) / (b*b * x1)

 the point on the ellipse = (x1, y1)
 point on normal = (x, y)

The length of the normal (to where it crosses the x-axis):

 n = b * sqrt(a*a*a*a - e*e * x1*x1) / (a*a)

The length of the subnormal (as above but along the x-axis):

 sn = abs( b*b * x1 / (a*a) )  

Hope that it helps.
We're here if you need more help.

Regards,
/Karl Hammar

[1]
 Mathematische formeln
 Dipl.-Ing. Hans-Jochen Bartsch
 Veb Fachbuschverlag Leipzig 1974

-----------------------------------------------------------------------
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