%%%% prbla_11.ldf
%%%% Created by Laurence D. Finston (LDF) Mon Nov 21 20:57:02 CET 2005
%% * (1) Copyright and License.
%%%% This file is part of GNU 3DLDF, a package for three-dimensional drawing.
%%%% Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 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
%%%% c/o The Free Software Foundation, Inc.
%%%% 51 Franklin St, Fifth Floor
%%%% Boston, MA 02110-1301
%%%% USA
%%%% Laurence.Finston@gmx.de
%% Run these commands:
%% 3dldf prbla_11.ldf
%% mpost prbla_11
%% tex prbla_11.txt
%% dvips -o prbla_11.ps prbla_11.dvi
%% gv prbla_11.ps &
%% *** (3) The intersection of a `parabola' and a `plane'.
verbatim_metapost "verbatimtex \magnification=\magstep5 \font\large=cmr12 etex";
focus f;
set f with_position (-5, 10, -20) with_direction (-5, 10, 100) with_distance 15;
pickup pencircle scaled (1mm, 1mm);
beginfig(1);
parabola prb[];
set prb0 with_parameter 3 with_extent 12;
set prb1 with_parameter 3 with_extent 30;
draw prb1 dashed with_dots;
draw prb0;
rectangle r;
r := unit_rectangle scaled (30, 0, 15) rotated (75, 20) shifted (5, 0, 3);
draw r with_color red;
plane pln;
pln := get_plane r;
bool_point_vector bpv;
bpv := prb0 intersection_points pln;
message "bpv:";
show bpv;
point p[];
p0 := bpv0;
p1 := bpv1;
path pth[];
pth0 := p0 -- p1;
bool_point_vector cpv;
cpv := r intersection_points pth0;
p2 := cpv0;
p3 := cpv1;
pth1 := p2 -- p3;
draw pth1 dashed with_dots with_color red;
%% **** (4)
pickup pencircle scaled (1mm, 1mm);
verbatim_metapost "pickup pencircle scaled .75mm";
if size bpv > 0:
dotlabel.top("$p_0$", bpv0) with_dot_color blue;
fi;
if size bpv > 1:
dotlabel.ulft("$p_1$", bpv1) with_dot_color blue;
fi;
if false:
if size cpv > 0:
dotlabel.urt(2, cpv0) with_dot_color blue;
fi;
if size cpv > 1:
dotlabel.lft(3, cpv1) with_dot_color blue;
fi;
fi;
%% **** (4)
endfig with_focus f;
verbatim_metapost "end";
end;