%%%% hyprb_03.ldf
%%%% Created by Laurence D. Finston (LDF) Mon Nov 28 16:06:23 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
%% *** (3) Classifying `points' with respect to a `hyperbola' using
%% the `location' operator.
%%
%% LDF 2005.11.28.
verbatim_metapost "verbatimtex \magnification=\magstep5 \font\large=cmr12 etex";
pickup pencircle scaled (.75mm, .75mm);
beginfig(1);
hyperbola h[];
set h0 with_max_extent 10;
set h1 with_max_extent 7;
point p[];
numeric L[];
%% **** (4) On hyperbola segment:
p0 := get_point 32 h1;
L0 := p0 location h1;
message "L0:";
show L0;
%% **** (4) On hyperbola, but not segment:
p1 := get_point 5 h0;
L1 := p1 location h1;
message "L1:";
show L1;
%% **** (4) Between center and one of the foci:
p2 := (.5, 0, 3);
L2 := p2 location h1;
message "L2:";
show L2;
%% **** (4) Within the region enclosed by the branches of
%% one of the halves of the hyperbola segment.
p3 := p0 rotated (180, 0, 180) shifted -1;
L3 := p3 location h1;
message "L3:";
show L3;
%% **** (4) Within the region enclosed by the branches of
%% one of the halves of the hyperbola, but not the segment.
p4 := p1 rotated (180, 0, 180) shifted -1;
L4 := p4 location h1;
message "L4:";
show L4;
%% **** (4) `point' is coplanar with the hyperbola, but does not lie on the curve,
%% within one of the regions enclosed by the branches, or between the branches.
%%
p5 := p1 rotated 180 shifted -1;
L5 := p5 location h1;
message "L5:";
show L5;
%% **** (4) `point' is not coplanar with the hyperbola.
p6 := p0 shifted (-1, 1, -5);
L6 := p6 location h1;
message "L6:";
show L6;
%% **** (4) Drawing commands.
pickup pencircle scaled (.75mm, .75mm);
draw h0 dashed with_dots;
draw h1 with_color blue;
%% **** (4) Labels.
pickup pencircle scaled (2mm, 2mm);
for i = 0 upto 6:
drawdot p[i] with_color red;
endfor;
string s;
s := "$p_0$, $l = " & decimal L[0] & "$";
label.rt(s, p0 shifted .25);
s := "$p_1$, $l = " & decimal L[1] & "$";
label.lft(s, p1 shifted -.25);
s := "\setbox0=\hbox{$l = " & decimal L[2] & "$}\vbox{\hbox to \wd0{\hfil$p_2$,\hfil}\box0}";
label.top(s, p2 shifted (0, 0, .25));
s := "$p_3$, $l = " & decimal L[3] & "$";
label.lft(s, p3 shifted -.25);
s := "$p_4$, $l = " & decimal L[4] & "$";
label.lft(s, p4 shifted -.25);
s := "$p_5$, $l = " & decimal L[5] & "$";
label.lft(s, p5 shifted -.25);
s := "\setbox0=\hbox{$p_6$ ($y \\neq 0$),}\vbox{\copy0\hbox to \wd0{\hfil $l = "
& decimal L[6] & "$\hfil}}";
label.bot(s, p6 shifted (0, 0, -.25));
%% **** (4)
endfig with_projection parallel_x_z;
verbatim_metapost "end";
end;