/[3dldf]/3dldf/Group/examples/hyprb_03.ldf
ViewVC logotype

Contents of /3dldf/Group/examples/hyprb_03.ldf

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Mon Apr 12 11:03:19 2021 UTC (3 years, 6 months ago) by lfinsto1
Branch: MAIN
CVS Tags: HEAD
Summary: Initial versions in CVS repository.  Copied from Git repository.

1 %%%% hyprb_03.ldf
2 %%%% Created by Laurence D. Finston (LDF) Mon Nov 28 16:06:23 CET 2005
3
4 %% * (1) Copyright and License.
5
6 %%%% This file is part of GNU 3DLDF, a package for three-dimensional drawing.
7 %%%% Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The Free Software Foundation
8
9 %%%% GNU 3DLDF is free software; you can redistribute it and/or modify
10 %%%% it under the terms of the GNU General Public License as published by
11 %%%% the Free Software Foundation; either version 3 of the License, or
12 %%%% (at your option) any later version.
13
14 %%%% GNU 3DLDF is distributed in the hope that it will be useful,
15 %%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
16 %%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 %%%% GNU General Public License for more details.
18
19 %%%% You should have received a copy of the GNU General Public License
20 %%%% along with GNU 3DLDF; if not, write to the Free Software
21 %%%% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
23 %%%% GNU 3DLDF is a GNU package.
24 %%%% It is part of the GNU Project of the
25 %%%% Free Software Foundation
26 %%%% and is published under the GNU General Public License.
27 %%%% See the website http://www.gnu.org
28 %%%% for more information.
29 %%%% GNU 3DLDF is available for downloading from
30 %%%% http://www.gnu.org/software/3dldf/LDF.html.
31
32 %%%% Please send bug reports to Laurence.Finston@gmx.de
33 %%%% The mailing list help-3dldf@gnu.org is available for people to
34 %%%% ask other users for help.
35 %%%% The mailing list info-3dldf@gnu.org is for the maintainer of
36 %%%% GNU 3DLDF to send announcements to users.
37 %%%% To subscribe to these mailing lists, send an
38 %%%% email with ``subscribe <email-address>'' as the subject.
39
40 %%%% The author can be contacted at:
41
42 %%%% Laurence D. Finston
43 %%%% c/o The Free Software Foundation, Inc.
44 %%%% 51 Franklin St, Fifth Floor
45 %%%% Boston, MA 02110-1301
46 %%%% USA
47
48 %%%% Laurence.Finston@gmx.de
49
50
51
52 %% *** (3) Classifying `points' with respect to a `hyperbola' using
53 %% the `location' operator.
54 %%
55 %% LDF 2005.11.28.
56
57 verbatim_metapost "verbatimtex \magnification=\magstep5 \font\large=cmr12 etex";
58
59 pickup pencircle scaled (.75mm, .75mm);
60
61 beginfig(1);
62 hyperbola h[];
63 set h0 with_max_extent 10;
64 set h1 with_max_extent 7;
65
66 point p[];
67 numeric L[];
68
69 %% **** (4) On hyperbola segment:
70
71 p0 := get_point 32 h1;
72 L0 := p0 location h1;
73 message "L0:";
74 show L0;
75
76 %% **** (4) On hyperbola, but not segment:
77
78 p1 := get_point 5 h0;
79 L1 := p1 location h1;
80 message "L1:";
81 show L1;
82
83 %% **** (4) Between center and one of the foci:
84
85 p2 := (.5, 0, 3);
86 L2 := p2 location h1;
87 message "L2:";
88 show L2;
89
90 %% **** (4) Within the region enclosed by the branches of
91 %% one of the halves of the hyperbola segment.
92
93 p3 := p0 rotated (180, 0, 180) shifted -1;
94
95 L3 := p3 location h1;
96 message "L3:";
97 show L3;
98
99 %% **** (4) Within the region enclosed by the branches of
100 %% one of the halves of the hyperbola, but not the segment.
101
102 p4 := p1 rotated (180, 0, 180) shifted -1;
103
104 L4 := p4 location h1;
105 message "L4:";
106 show L4;
107
108 %% **** (4) `point' is coplanar with the hyperbola, but does not lie on the curve,
109 %% within one of the regions enclosed by the branches, or between the branches.
110 %%
111
112 p5 := p1 rotated 180 shifted -1;
113
114 L5 := p5 location h1;
115 message "L5:";
116 show L5;
117
118 %% **** (4) `point' is not coplanar with the hyperbola.
119
120 p6 := p0 shifted (-1, 1, -5);
121
122 L6 := p6 location h1;
123 message "L6:";
124 show L6;
125
126 %% **** (4) Drawing commands.
127
128 pickup pencircle scaled (.75mm, .75mm);
129
130 draw h0 dashed with_dots;
131 draw h1 with_color blue;
132
133 %% **** (4) Labels.
134
135 pickup pencircle scaled (2mm, 2mm);
136
137 for i = 0 upto 6:
138 drawdot p[i] with_color red;
139 endfor;
140
141 string s;
142
143 s := "$p_0$, $l = " & decimal L[0] & "$";
144 label.rt(s, p0 shifted .25);
145
146 s := "$p_1$, $l = " & decimal L[1] & "$";
147 label.lft(s, p1 shifted -.25);
148
149 s := "\setbox0=\hbox{$l = " & decimal L[2] & "$}\vbox{\hbox to \wd0{\hfil$p_2$,\hfil}\box0}";
150 label.top(s, p2 shifted (0, 0, .25));
151
152 s := "$p_3$, $l = " & decimal L[3] & "$";
153 label.lft(s, p3 shifted -.25);
154
155 s := "$p_4$, $l = " & decimal L[4] & "$";
156 label.lft(s, p4 shifted -.25);
157
158 s := "$p_5$, $l = " & decimal L[5] & "$";
159 label.lft(s, p5 shifted -.25);
160
161 s := "\setbox0=\hbox{$p_6$ ($y \\neq 0$),}\vbox{\copy0\hbox to \wd0{\hfil $l = "
162 & decimal L[6] & "$\hfil}}";
163 label.bot(s, p6 shifted (0, 0, -.25));
164
165 %% **** (4)
166
167 endfig with_projection parallel_x_z;
168
169 verbatim_metapost "end";
170
171 end;
172

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26