%%%% prbla_10.ldf %%%% Created by Laurence D. Finston (LDF) Mon Nov 21 17:58:07 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 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. %%%% It is also available from %%%% http://www.dante.de/software/ctan/, the Dante www-server %%%% and from http://wwwuser.gwdg.de/~lfinsto1, %%%% the author's website. %%%% Please send bug reports to lfinsto1@gwdg.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 %%%% lfinsto1@gwdg.de %%%% s246794@stud.uni-goettingen.de %% Run these commands: %% 3dldf prbla_10.ldf %% mpost prbla_10 %% tex prbla_10.txt %% dvips -o prbla_10.ps prbla_10.dvi %% gv prbla_10.ps & %% *** (3) The location of a `point' with respect to a `parabola'. %% LDF 2005.11.21. verbatim_metapost "verbatimtex \magnification=\magstep5 \font\large=cmr12 etex"; picture axis_picture; %% **** (4) axis_picture. beginfig(0); pickup pencircle scaled (1mm, 1mm); axis_x_lft := 5; axis_x_rt := 15; axis_y_bot := 10; axis_y_top := 10; axis_z_front := 7; axis_z_back := 10; drawarrow origin -- (-axis_x_lft, 0); drawarrow origin -- (axis_x_rt, 0); label.bot("x", (axis_x_rt, 0, -.1)); drawarrow origin -- (0, -axis_y_bot); drawarrow origin -- (0, axis_y_top); label.lft("y", (0, axis_y_top)); drawarrow origin -- (0, 0, -axis_z_front); drawarrow origin -- (0, 0, axis_z_back); label.lft("z", (-.25, 0, axis_z_back)); axis_picture := current_picture; clear current_picture; endfig; 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 parab[]; set parab0 with_parameter 3 with_extent 7; set parab1 with_parameter 3 with_extent 12; transform t; t := identity rotated (60, 15) shifted (1, 0, -2); parab0 *= parab1 *= t; draw parab1 with_color red dashed with_dots; draw parab0 with_color blue; point p[]; %% **** (4) %% ***** (5) 0: On parabola segment. p0 := get_point 4 parab0; numeric pos[]; pos0 := p0 location parab0; message "pos0:"; show pos0; %% ***** (5) 1: On parabola, but not segment. p1 := get_point 2 parab1; numeric pos[]; pos1 := p1 location parab0; message "pos1:"; show pos1; %% ***** (5) 2: Within the region enclosed by the branches of %% the parabola and the line connecting the end points %% of the segment. p10 := get_point (size parab0 - 2) parab0; p2 := mediate(p0, p10); pos2 := p2 location parab0; message "pos2:"; show pos2; %% ***** (5) 3: Between the branches of the parabola, but %% outside the region enclosed by them and the %% line connecting the end points of the segment. p11 := get_point (size parab1 - 2) parab1; p3 := mediate(p1, p11); draw p1 -- p11 dashed withdots with_color red; pos3 := p3 location parab0; message "pos3:"; show pos3; %% ***** (5) -1: Coplanar with the parabola, but %% does not lie on the curve or between the branches. p4 := mediate(p0, p10, 1.25); draw p0 -- p4 dashed withdots with_color dark_gray; pos4 := p4 location parab0; message "pos4:"; show pos4; %% ***** (5) -2: Not coplanar with the parabola. p5 := (13, 9, -2); pos5 := p5 location parab0; message "pos5:"; show pos5; %% ***** (5) %% **** (4) output axis_picture with_focus f; output current_picture with_focus f; clear current_picture; %% **** (4) verbatim_metapost "pickup pencircle scaled 1mm;"; %pickup pencircle scaled (1mm, 1mm); dotlabel.ulft("\vbox{\hbox{$p_0$,}\hbox{$l = 0$}}", p0); drawdot p1; label.rt("$p_1$, $l = 1$", p1 shifted (.25, 0)); dotlabel.lrt("$p_2$, $l = 2$", p2); drawdot p3; label.urt("$p_3$, $l = 3$", p3 shifted (.25, 0)); dotlabel.lrt("$p_4$, $l = -1$", p4); label.top("$p_5$", p5 shifted (0, .25)); dotlabel.bot("$l = -2$", p5); %dotlabel.llft("$p_{10}$", p10); %dotlabel.bot("$p_{11}$", p11); %% **** (4) endfig with_focus f no_sort; %with_projection parallel_x_z; verbatim_metapost "end"; end;