%%%% braik_03.ldf %%%% Created by Laurence D. Finston (LDF) Tue Aug 7 20:06:12 CEST 2007 %%%% This file is part of GNU 3DLDF, a package for three-dimensional drawing. %%%% Copyright (C) 2007, 2008, 2009, 2010, 2011 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 3 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 %%%% GNU 3DLDF is a GNU package. %%%% It is part of the GNU Project of the %%%% Free Software Foundation %%%% and is published under the GNU General Public License. %%%% See the website http://www.gnu.org %%%% for more information. %%%% GNU 3DLDF is available for downloading from %%%% http://www.gnu.org/software/3dldf/LDF.html. %%%% Please send bug reports to Laurence.Finston@gmx.de %%%% The mailing list help-3dldf@gnu.org is available for people to %%%% ask other users for help. %%%% The mailing list info-3dldf@gnu.org is for the maintainer of %%%% GNU 3DLDF to send announcements to users. %%%% To subscribe to these mailing lists, send an %%%% email with ``subscribe '' as the subject. %%%% The author can be contacted at: %%%% Laurence D. Finston %%%% Kreuzbergring 41 %%%% D-37075 Goettingen %%%% Germany %%%% Laurence.Finston@gmx.de %% *** (3) Braikenridge-Maclaurin Construction. %% Constructing a conic section from 5 points. %% Run like this: %% 3dldf braik_03 %% mpost braik_03 %% tex braik_03.txt %% dvips -o braik_03.ps braik_03.dvi %% Create PostScript file %% ps2pdf braik_03.ps %% Create PDF file %% 3dldf braik_03; mpost braik_03; tex braik_03.txt; dvips -o braik_03.ps braik_03.dvi %% *** (3) Pascal's Theorem and Braikenridge-Maclaurin Construction. %% Constructing a conic section from 5 or 6 points. verbatim_metapost "verbatimtex \magnification=\magstep2 etex"; %% **** (4) Frame pen_width := .5mm; pickup pencircle scaled (pen_width, pen_width, pen_width); w := 18cm; h := 18cm; frame_w := w - .5pen_width; frame_h := h - .5pen_width; path frame; frame := origin -- (frame_w, 0) -- (frame_w, 0, frame_h) -- (0, 0, frame_h) -- cycle; shift frame (-.5frame_w, 0, -.5frame_h); %% **** (4) Declarations boolean b; numeric i; numeric j; point A, B, C, D, E; %% The given points point F; %% The point found using `get_point' point X, Y, Z; %% The intersection points point save_A, save_B, save_C, save_D, save_E; bool_point bp; pen dot_pen; dot_pen := pencircle scaled (1.5mm, 1.5mm); pen path_pen; path_pen := pencircle scaled (.7mm, .7mm); string s; ellipse e[]; point p[]; path q[]; conic_section_lattice c; point label_pt; %% **** (4) Set ellipse and initial points. e0 := unit_ellipse scaled (5, 0, 3) rotated (15, 15, 15) shifted (0, 0, .5) ; p0 := get_point (6) e0; p1 := get_point (11) e0; p2 := get_point (18) e0; p3 := get_point (2) e0; p4 := get_point (25) e0; p5 := get_point (19) e0; %% **** (4) point_vector pv; pv += p0; pv += p2; pv += p3; pv += p1; pv += p5; pv += p4; %% **** (4) Set conic section lattice. c := get_conic_section_lattice pv; %shift_lattice c, 1; %% **** (4) Set label point label_pt := (0, 0, .5frame_h -1.5); %% **** (4) Commands for labels verbatim_metapost "verbatimtex \font\largebf=cmbx12 etex;"; %% **** (4) Figures %% ***** (5) Figures 0 to 9 for i = 0 upto 9: beginfig(i); draw e0 with_pen path_pen; A := get_point c with_increment 0; B := get_point c with_increment 1; C := get_point c with_increment 2; D := get_point c with_increment 3; E := get_point c with_increment 4; if (i) == 0: F := A; else: F := get_point c with_increment i / 10 with_no_shift; fi; pickup dot_pen; dotlabel.llft("$A$", A) with_text_color red; dotlabel.ulft("$B$", B) with_text_color red; dotlabel.top("$C$", C) with_text_color red; dotlabel.urt("$D$", D) with_text_color red; dotlabel.bot("$E$", E) with_text_color red; label.llft("$A'$", A shifted (0, 0, -.5)); label.ulft("$B'$", B shifted (0, 0, .5)); label.top("$C'$", C shifted (0, 0, .5)); label.urt("$D'$", D shifted (.5, 0, .5)); label.bot("$E'$", E shifted (0, 0, -.5)); dotlabel.bot("$F$", F) with_text_color red; pickup path_pen; draw A -- C; draw B -- D; draw B -- E; draw E -- A; draw C -- F; draw F -- D; bp := (A -- C) intersection_point (B -- D); X := bp; bp := (C -- F) intersection_point (B -- E); Y := bp; bp := (F -- D) intersection_point (E -- A); if (i) == 0: Z := A; else: Z := bp; fi; draw X -- Z with_color green; pickup dot_pen; dotlabel.ulft("$X$", X) with_dot_color blue; dotlabel.urt("$Y$", Y) with_dot_color blue; dotlabel.lrt("$Z$", Z) with_dot_color blue; if false: if (i) == 0: s := "\vtop{\centerline{{\largebf The Braikenridge-Maclaurin Construction 3}}" & "\vskip.5\baselineskip" & "\centerline{Copyright {\copyright} 2007, 2008, 2009, 2010, 2011 The Free Software Foundation}" & "\centerline{Author: Laurence D. Finston}}"; label(s, label_pt); fi; fi; draw frame with_pen pensquare scaled (1.5mm, 1.5mm); endfig with_projection parallel_x_z no_sort; endfor; %% ***** (5) Figures 10 to 19 save_A := A; save_B := B; save_C := C; save_D := D; save_E := E; shift_lattice c, 1; for i = 0 upto 9: beginfig(10 + i); draw e0 with_pen path_pen; dotlabel.llft("$A$", save_A) with_text_color red; dotlabel.ulft("$B$", save_B) with_text_color red; dotlabel.top("$C$", save_C) with_text_color red; dotlabel.urt("$D$", save_D) with_text_color red; dotlabel.bot("$E$", save_E) with_text_color red; A := get_point c with_increment 0; B := get_point c with_increment 1; C := get_point c with_increment 2; D := get_point c with_increment 3; E := get_point c with_increment 4; label.llft("$B'$", B shifted (0, 0, -.5)); label.ulft("$C'$", C shifted (0, 0, .5)); label.top("$D'$", D shifted (0, 0, .5)); label.urt("$E'$", E shifted (.5, 0, .5)); label.bot("$A'$", A shifted (0, 0, -.5)); if (i) == 0: F := A; else: F := get_point c with_increment i / 10; fi; dotlabel.bot("$F$", F) with_text_color red; pickup path_pen; draw A -- C; draw B -- D; draw B -- E; draw E -- A; draw C -- F; draw F -- D; bp := (A -- C) intersection_point (B -- D); X := bp; bp := (C -- F) intersection_point (B -- E); Y := bp; bp := (F -- D) intersection_point (E -- A); if (i) == 0: Z := F; else: Z := bp; fi; draw X -- Z with_color green; pickup dot_pen; dotlabel.ulft("$X$", X) with_dot_color blue; dotlabel.urt("$Y$", Y) with_dot_color blue; dotlabel.lrt("$Z$", Z) with_dot_color blue; draw frame with_pen pensquare scaled (1.5mm, 1.5mm); endfig with_projection parallel_x_z no_sort; endfor; %% ***** (5) Figures 20 to 29 shift_lattice c, 1; for i = 0 upto 9: beginfig(20 + i); draw e0 with_pen path_pen; dotlabel.llft("$A$", save_A) with_text_color red; dotlabel.ulft("$B$", save_B) with_text_color red; dotlabel.top("$C$", save_C) with_text_color red; dotlabel.urt("$D$", save_D) with_text_color red; dotlabel.bot("$E$", save_E) with_text_color red; A := get_point c with_increment 0; B := get_point c with_increment 1; C := get_point c with_increment 2; D := get_point c with_increment 3; E := get_point c with_increment 4; label.llft("$C'$", C shifted (0, 0, -.5)); label.ulft("$D'$", D shifted (0, 0, .5)); label.top("$E'$", E shifted (0, 0, .5)); label.urt("$A'$", A shifted (.5, 0, .5)); label.bot("$B'$", B shifted (0, 0, -.5)); if (i) == 0: F := A; else: F := get_point c with_increment i / 10; fi; dotlabel.bot("$F$", F) with_text_color red; pickup path_pen; draw A -- C; draw B -- D; draw B -- E; draw E -- A; draw C -- F; draw F -- D; bp := (A -- C) intersection_point (B -- D); X := bp; bp := (C -- F) intersection_point (B -- E); Y := bp; bp := (F -- D) intersection_point (E -- A); if (i) == 0: Z := F; else: Z := bp; fi; draw X -- Z with_color green; pickup dot_pen; dotlabel.ulft("$X$", X) with_dot_color blue; dotlabel.urt("$Y$", Y) with_dot_color blue; dotlabel.lrt("$Z$", Z) with_dot_color blue; draw frame with_pen pensquare scaled (1.5mm, 1.5mm); endfig with_projection parallel_x_z no_sort; endfor; %% ***** (5) Figures 30 to 39 shift_lattice c, 1; for i = 0 upto 9: beginfig(30 + i); draw e0 with_pen path_pen; dotlabel.llft("$A$", save_A) with_text_color red; dotlabel.ulft("$B$", save_B) with_text_color red; dotlabel.top("$C$", save_C) with_text_color red; dotlabel.urt("$D$", save_D) with_text_color red; dotlabel.bot("$E$", save_E) with_text_color red; A := get_point c with_increment 0; B := get_point c with_increment 1; C := get_point c with_increment 2; D := get_point c with_increment 3; E := get_point c with_increment 4; label.llft("$D'$", D shifted (0, 0, -.5)); label.ulft("$E'$", E shifted (0, 0, .5)); label.top("$A'$", A shifted (0, 0, .5)); label.urt("$B'$", B shifted (.5, 0, .5)); label.bot("$C'$", C shifted (0, 0, -.5)); if (i) == 0: F := A; else: F := get_point c with_increment i / 10; fi; dotlabel.bot("$F$", F) with_text_color red; pickup path_pen; draw A -- C; draw B -- D; draw B -- E; draw E -- A; draw C -- F; draw F -- D; bp := (A -- C) intersection_point (B -- D); X := bp; bp := (C -- F) intersection_point (B -- E); Y := bp; bp := (F -- D) intersection_point (E -- A); if (i) == 0: Z := F; else: Z := bp; fi; draw X -- Z with_color green; pickup dot_pen; dotlabel.ulft("$X$", X) with_dot_color blue; dotlabel.urt("$Y$", Y) with_dot_color blue; dotlabel.lrt("$Z$", Z) with_dot_color blue; draw frame with_pen pensquare scaled (1.5mm, 1.5mm); endfig with_projection parallel_x_z no_sort; endfor; %% ***** (5) Figures 40 to 49 shift_lattice c, 1; for i = 0 upto 9: beginfig(40 + i); draw e0 with_pen path_pen; dotlabel.llft("$A$", save_A) with_text_color red; dotlabel.ulft("$B$", save_B) with_text_color red; dotlabel.top("$C$", save_C) with_text_color red; dotlabel.urt("$D$", save_D) with_text_color red; dotlabel.bot("$E$", save_E) with_text_color red; A := get_point c with_increment 0; B := get_point c with_increment 1; C := get_point c with_increment 2; D := get_point c with_increment 3; E := get_point c with_increment 4; label.llft("$E'$", E shifted (0, 0, -.5)); label.ulft("$A'$", A shifted (0, 0, .5)); label.top("$B'$", B shifted (0, 0, .5)); label.urt("$C'$", C shifted (.5, 0, .5)); label.bot("$D'$", D shifted (0, 0, -.5)); if (i) == 0: F := A; else: F := get_point c with_increment i / 10; fi; dotlabel.bot("$F$", F) with_text_color red; pickup path_pen; draw A -- C; draw B -- D; draw B -- E; draw E -- A; draw C -- F; draw F -- D; bp := (A -- C) intersection_point (B -- D); X := bp; bp := (C -- F) intersection_point (B -- E); Y := bp; bp := (F -- D) intersection_point (E -- A); if (i) == 0: Z := F; else: Z := bp; fi; draw X -- Z with_color green; pickup dot_pen; dotlabel.ulft("$X$", X) with_dot_color blue; dotlabel.urt("$Y$", Y) with_dot_color blue; dotlabel.lrt("$Z$", Z) with_dot_color blue; draw frame with_pen pensquare scaled (1.5mm, 1.5mm); endfig with_projection parallel_x_z no_sort; endfor; %% **** (4) End. verbatim_metapost "end"; end;