[metapost] Re: Constructing ellipse from 4 points
lfinsto1 at gwdg.de
Thu Nov 3 19:59:11 CET 2005
Just in case anyone's interested, I've found a solution
to the problem of finding the ellipse determined by 6 (not 4)
non-colinear points. It's called the "Braikenridge-Maclaurin
Construction" and is the converse of Pascal's Theorem. I found it here:
It seems to require 6 to start with, but then you use the
other 5 to find as many more as you want.
I've attached an image and the 3DLDF code that generates it.
Since it's 2D, I could have done it with MetaPost, but converting
it should be straightforward, if anyone is so inclined.
The text on the first website states that the ellipse is traced by F when
the line XYZ is rotated about X. I believe this to be an error. At least,
I couldn't get it to work. Instead, I shifted Z' along the line AE and
took Y' as the intersection point of XZ' and BE.
Since I can generate as many points as I want this way, I believe it
should be possible to find a pair of parallel secants, or a pair of
conjugate axes. There are then easy ways to find the main axes,
center, and foci. I think I will do this another day, though.
For the intersection of a plane with an ellipsoid,
I'll have to transform my points to a major plane and then transform the
ellipse using the inverse of the first transformation, but I do this often
anyway. So, with a bit of luck, I should be be able to solve the problem
now. Then I can start working on the intersection of a line with an
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 13953 bytes
Url : http://tug.org/pipermail/metapost/attachments/20051103/2184e01a/ellpcn01.ps.obj
-------------- next part --------------
%%%% Created by Laurence D. Finston (LDF) Thu Nov 3 19:41:14 CET 2005
%% * (1) Copyright and License.
%%%% This file is part of GNU 3DLDF, a package for three-dimensional drawing.
%%%% Copyright (C) 2003, 2004, 2005 The Free Software Foundation
%%%% GNU 3DLDF is free software; you can redistribute it and/or modify
%%%% it under the terms of the GNU General Public License as published by
%%%% the Free Software Foundation; either version 2 of the License, or
%%%% (at your option) any later version.
%%%% GNU 3DLDF is distributed in the hope that it will be useful,
%%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
%%%% GNU General Public License for more details.
%%%% You should have received a copy of the GNU General Public License
%%%% along with GNU 3DLDF; if not, write to the Free Software
%%%% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
%% Braikenridge-Maclaurin Construction.
%% Constructing an ellipse from 6 points.
%% LDF 2005.11.03.
verbatim_metapost "verbatimtex \magnification=\magstep2 etex";
e := unit_ellipse scaled (4, 0, 3);
path_pen := pencircle scaled (.7mm, .7mm);
point A, B, C, D, E, F;
A := get_point (15) e;
B := get_point (11) e;
C := get_point (8) e;
D := get_point (6) e;
E := get_point (3) e;
F := get_point (0) e;
dot_pen := pencircle scaled (1mm, 1mm);
dotlabel.rt("A", A) with_dot_color red;
dotlabel.bot("B", B) with_dot_color red;
dotlabel.lft("C", C) with_dot_color red;
dotlabel.lft("D", D) with_dot_color red;
dotlabel.top("E", E) with_dot_color red;
dotlabel.rt("F", F) with_dot_color red;
pickup pencircle scaled (.7mm, .7mm);
%% **** (4) Point X
q0 := A -- C;
q1 := B -- D;
X := q0 intersection_point q1;
dotlabel.llft("$X$", X) with_dot_color red;
%% **** (4) Point Y
q2 := B -- E;
q3 := C -- F;
Y := q2 intersection_point q3;
dotlabel.ulft("$Y$", Y) with_dot_color red;
%% **** (4) Point Z
q4 := A -- E;
q5 := D -- F;
Z := q4 intersection_point q5;
dotlabel.urt("$Z$", Z) with_dot_color red;
%% **** (4)
Z' := mediate(Z, E, .5);
dotlabel.urt("$Z'$", Z') with_dot_color red;
Y' := (B -- E) intersection_point (Z' -- X);
dotlabel.lrt("$Y'$", Y') with_dot_color red;
G := mediate(C, Y', 2);
draw C -- G with_pen path_pen dashed evenly;
H := mediate(D, Z', 2);
draw D -- H with_pen path_pen dashed evenly;
J := (C -- G) intersection_point (D -- H);
drawdot J with_color red;
label.urt("$J$", J shifted (0, 0, .25));
endfig with_projection parallel_x_z no_sort;
More information about the metapost