summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/fonts/source/public/circ/ciphysic.mf
blob: a1d28d887cd31bcfa8a405e56b596ef35c6df020 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
%%
%% This is file `ciphysic.mf',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% circ.dtx  (with options: `ciphysicmf')
%% CIRC is a LaTeX package to typeset circuit and optics diagrams.
%% Copyright (C) 1997,1998,2003  Sebastian Tannert and Andreas Tille
%% 
%%   This program 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 2 of the License, or
%%   (at your option) any later version.
%% 
%%   This program 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 this program; if not, write to the Free Software
%%   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
%% 
%% For error reports concerning UNCHANGED versions of this file no
%% more than one year old, see CIRC.DVI after installation.
%% If installation fails search thru this file for 'bug'.
font_identifier:="ciphysic";

string optionname; optionname:="physics";

input defcirc.mf;

%% SPRING

spring_lt#= 5CIu#;
lspring_lt#= 7CIu#;
spring_th#= 1CIu#;
define_whole_pixels(lspring_lt,spring_lt,spring_th);
spring_gap= .6CIu;
spring_n=11;
spring_swd=(spring_lt-2spring_gap)/spring_n;
lspring_swd=(lspring_lt-2spring_gap)/spring_n;

twopinchar("spring")("k")("spring")
  (spring_lt#, .5spring_th#, .5spring_th#)
( pickup pensquare scaled normalline;
  z0=(0,0);
  shiftpoint:=z0+(spring_lt,0);
  z1=z0+(spring_gap,0);
  draw z0--z1;
  pickup pencircle scaled normalline;
  for i:=1 upto spring_n:
    x[i+1]=x[i]+spring_swd; y[i+1]=y[0]+if odd(i): 1 else: -1 fi*.5spring_th;
    if i=spring_n: y[i+1]:=y[i+1]-if odd(i): 1 else: -1 fi*.5spring_th fi;
    draw z[i]--z[i+1];
  endfor;
  z[spring_n+2]=z0+(spring_lt,0);
  pickup pensquare scaled normalline;
  z[spring_n+2]=z0+(spring_lt,0);
  draw z[spring_n+1]--z[spring_n+2];
)

twopinchar("lspring")("k")("long spring")
  (lspring_lt#, .5spring_th#, .5spring_th#)
( pickup pensquare scaled normalline;
  z0=(0,0);
  shiftpoint:=z0+(lspring_lt,0);
  z1=z0+(spring_gap,0);
  draw z0--z1;
  pickup pencircle scaled normalline;
  for i:=1 upto spring_n:
    x[i+1]=x[i]+lspring_swd; y[i+1]=y[0]+if odd(i): 1 else: -1 fi*.5spring_th;
    if i=spring_n: y[i+1]:=y[i+1]-if odd(i): 1 else: -1 fi*.5spring_th fi;
    draw z[i]--z[i+1];
  endfor;
  z[spring_n+2]=z0+(lspring_lt,0);
  pickup pensquare scaled normalline;
  draw z[spring_n+1]--z[spring_n+2];
)

%% MASS single/double

dmass_lt#= 2CIu#;
mass_r#=  1.5CIu#;
define_whole_pixels(dmass_lt,mass_r);

twopinchar("fdmass")("m")("mass with two forces; full drawn")
  (dmass_lt#, .5mass_r#, .5mass_r#)
(  pickup pensquare scaled normalline;
   z0=(0,0);
   z1=z0+(dmass_lt,0);
   shiftpoint:=z1;
   draw z0--z1;
   z2=.5[z0,z1];
   pickup pencircle scaled mass_r;
   drawdot z2;
)

twopinchar("dmass")("m")("mass with two forces; outlined")
  (dmass_lt#, .5mass_r#, .5mass_r#)
(  pickup pensquare scaled normalline;
   z0=(0,0);
   z1=z0+(.5(dmass_lt-mass_r),0);
   draw z0--z1;
   z3=z0+(dmass_lt,0);
   shiftpoint:=z3;
   z4=z3-(.5(dmass_lt-mass_r),0);
   draw z3--z4;
   z2=.5[z0,z3];
   pickup pencircle scaled normalline;
   draw fullcircle scaled mass_r shifted z2;
)

twopincharfour("fmass")("m")(".")("*")("mass; full drawn")
  (dmass_lt#, .5mass_r#, .5mass_r#)
(  pickup pensquare scaled normalline;
   z0=(0,0);
   z1=z0+(dmass_lt,0);
   z2=.5[z0,z1];
   draw z0--z2;
   pickup pencircle scaled mass_r;
   drawdot z2;

   shiftpoint:=z1;
)

twopincharfour("mass")("m")(".")("*")("mass; outlined")
  (dmass_lt#, .5mass_r#, .5mass_r#)
(  pickup pensquare scaled normalline;
   z0=(0,0);
   z1=z0+(.5(dmass_lt-mass_r),0);
   draw z0--z1;
   z3=z0+(dmass_lt,0);
   z2=.5[z0,z3];
   pickup pencircle scaled normalline;
   draw fullcircle scaled mass_r shifted z2;

   shiftpoint:=z3;
)

%% WALL

wall_lt#= 1.5CIu#;
wall_ht#= 2.5CIu#;
define_whole_pixels(wall_ht, wall_lt);
wall_f=1/3;
wall_n=6;
wall_alpha=40;

twopincharfour("wall")("{}")(".")("|")("wall")
  (wall_lt#,.5wall_ht#
               +wall_lt#*(1-wall_f)*sind(wall_alpha),.5wall_ht#)
(  pickup pensquare scaled normalline;
   z0=(0,0);
   z1=z0+(wall_f*wall_lt,0);
   draw z0--z1;
   z1=.5[z2,z3]; y3-y2=wall_ht; x3=x2;
   pickup pensquare scaled verythickline;
   draw z2--z3;
   path a;
   a=(0,0)--(1-wall_f)*wall_lt*dir(wall_alpha);
   pickup pencircle scaled normalline;
   for i:=0 upto wall_n: draw a shifted (i/wall_n)[z2,z3]; endfor

   shiftpoint:=z0+(wall_lt,0);
)

tile_lt#= 2CIu#;
tile_ht#= .4CIu#;
tile_f=0.1;

define_whole_pixels(tile_lt,tile_ht);

twopincharfour("tile")("{}")(".")("*")("tile")
  (wall_lt#,.5tile_ht#,.5tile_ht#)
(  pickup pensquare scaled normalline;
   z0=(0,0);
   z1=z0+(tile_lt,0);
   z2=tile_f[z0,z1];
   draw z0--z1;
   pickup pensquare scaled verythickline;
   draw z1--z2;
   shiftpoint:=z1;
)

spin_lt#= 2CIu#;
spin_r#=  .7CIu#;
spin_ht#= 2CIu#;
spin_alt= .5CIu;
spin_awd= .1CIu;
define_whole_pixels(spin_lt,spin_r, spin_ht);

twopinchar("spinu")("S")("spin up")
  (spin_lt#, .6spin_ht#, .6spin_ht#)
(  pickup pensquare scaled normalline;
   z0=(0,0);
   z1=z0+(spin_lt,0);
   draw z0--z1;
   z2=.5[z0,z1];
   y3-y4=spin_ht;
   x3=x4=x2;
   y2=.6[y3,y4];
   y5=y6=y3-spin_alt;
   x5=x2-spin_awd;
   x6=x2+spin_awd;
   draw z3--z4;
   filldraw z5--z3--z6--cycle;
   pickup pencircle scaled spin_r;
   drawdot z2;
   shiftpoint:=z1;
)

twopinchar("spind")("S")("spin down")
  (spin_lt#, .6spin_ht#, .6spin_ht#)
(  pickup pensquare scaled normalline;
   z0=(0,0);
   z1=z0+(spin_lt,0);
   draw z0--z1;
   z2=.5[z0,z1];
   y3-y4=-spin_ht;
   x3=x4=x2;
   y2=.6[y3,y4];
   y5=y6=y3+spin_alt;
   x5=x2-spin_awd;
   x6=x2+spin_awd;
   draw z3--z4;
   filldraw z5--z3--z6--cycle;
   pickup pencircle scaled spin_r;
   drawdot z2;
   shiftpoint:=z1;
)

endCIRCfont
%% 
%%
%% End of file `ciphysic.mf'.