Igor: > 2011/7/14 Karl Hammar <k...@aspodata.se>: > > Looking at pcb.pdf, page 64, section 8.8.1 Arc... ... > > And there is no way to specify a "slanted" ellipse in the file format > > either, so if we really want ellipses, the file format is incomplete > > and should be changed. > > > > 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 just liked the challenge with rotated ellipses especially checking for > intersection between them.
Well, one could add a int slant = 0; // TODO: add support for rotated ellipses and start debugging. Or why not add full support for slantet/rotated ellipses. It would affect documentation (file format), gui, src/search.c and possible other places. In your code, you translate to ellipse center, why not rotate so the ellipse is with the foci on the x-axis, wouldn't that make the calc. easier? You already have the a/b ((semi-)width/height above) and the slant (or what should we call the ellipse rotation), so it is only the test point (X,Y) we are rotating, and the ellipse would then be in the normal form (simpler to visualize), one could also mirror the system so X and Y > 0: x^2/a^2 + y^2/b^2 = 1, a >= b > 0 with foci at (0,c) and (0,-c) where c = sqrt(a^2 - b^2) One could possible use: . a normal to the ellipse bisects the rays from the foci . if P = (x,y) is on the perimeter, x > 0, y > 0 F = (0,c) a focus Q = (a/e, y), where e = c/a, y = the y of P then PF / PQ = e, PF = length P to F, dito. PQ /// And while we are at it, shouldn't we use a sane geometry where positive y's are up and zero angle is alinged with positive x-axis... Regards, /Karl Hammar ----------------------------------------------------------------------- Aspö Data Lilla Aspö 148 S-742 94 Östhammar Sweden +46 173 140 57 _______________________________________________ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user