| 1 |
%% |
| 2 |
%% This is file `ciphysic.mf', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% circ.dtx (with options: `ciphysicmf') |
| 8 |
%% CIRC is a LaTeX package to typeset circuit and optics diagrams. |
| 9 |
%% Copyright (C) 1997,1998,2003 Sebastian Tannert and Andreas Tille |
| 10 |
%% |
| 11 |
%% This program is free software; you can redistribute it and/or modify |
| 12 |
%% it under the terms of the GNU General Public License as published by |
| 13 |
%% the Free Software Foundation; either version 2 of the License, or |
| 14 |
%% (at your option) any later version. |
| 15 |
%% |
| 16 |
%% This program is distributed in the hope that it will be useful, |
| 17 |
%% but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 |
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 |
%% GNU General Public License for more details. |
| 20 |
%% |
| 21 |
%% You should have received a copy of the GNU General Public License |
| 22 |
%% along with this program; if not, write to the Free Software |
| 23 |
%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 24 |
%% |
| 25 |
%% For error reports concerning UNCHANGED versions of this file no |
| 26 |
%% more than one year old, see CIRC.DVI after installation. |
| 27 |
%% If installation fails search thru this file for 'bug'. |
| 28 |
font_identifier:="ciphysic"; |
| 29 |
|
| 30 |
string optionname; optionname:="physics"; |
| 31 |
|
| 32 |
input defcirc.mf; |
| 33 |
|
| 34 |
%% SPRING |
| 35 |
|
| 36 |
spring_lt#= 5CIu#; |
| 37 |
lspring_lt#= 7CIu#; |
| 38 |
spring_th#= 1CIu#; |
| 39 |
define_whole_pixels(lspring_lt,spring_lt,spring_th); |
| 40 |
spring_gap= .6CIu; |
| 41 |
spring_n=11; |
| 42 |
spring_swd=(spring_lt-2spring_gap)/spring_n; |
| 43 |
lspring_swd=(lspring_lt-2spring_gap)/spring_n; |
| 44 |
|
| 45 |
twopinchar("spring")("k")("spring") |
| 46 |
(spring_lt#, .5spring_th#, .5spring_th#) |
| 47 |
( pickup pensquare scaled normalline; |
| 48 |
z0=(0,0); |
| 49 |
shiftpoint:=z0+(spring_lt,0); |
| 50 |
z1=z0+(spring_gap,0); |
| 51 |
draw z0--z1; |
| 52 |
pickup pencircle scaled normalline; |
| 53 |
for i:=1 upto spring_n: |
| 54 |
x[i+1]=x[i]+spring_swd; y[i+1]=y[0]+if odd(i): 1 else: -1 fi*.5spring_th; |
| 55 |
if i=spring_n: y[i+1]:=y[i+1]-if odd(i): 1 else: -1 fi*.5spring_th fi; |
| 56 |
draw z[i]--z[i+1]; |
| 57 |
endfor; |
| 58 |
z[spring_n+2]=z0+(spring_lt,0); |
| 59 |
pickup pensquare scaled normalline; |
| 60 |
z[spring_n+2]=z0+(spring_lt,0); |
| 61 |
draw z[spring_n+1]--z[spring_n+2]; |
| 62 |
) |
| 63 |
|
| 64 |
twopinchar("lspring")("k")("long spring") |
| 65 |
(lspring_lt#, .5spring_th#, .5spring_th#) |
| 66 |
( pickup pensquare scaled normalline; |
| 67 |
z0=(0,0); |
| 68 |
shiftpoint:=z0+(lspring_lt,0); |
| 69 |
z1=z0+(spring_gap,0); |
| 70 |
draw z0--z1; |
| 71 |
pickup pencircle scaled normalline; |
| 72 |
for i:=1 upto spring_n: |
| 73 |
x[i+1]=x[i]+lspring_swd; y[i+1]=y[0]+if odd(i): 1 else: -1 fi*.5spring_th; |
| 74 |
if i=spring_n: y[i+1]:=y[i+1]-if odd(i): 1 else: -1 fi*.5spring_th fi; |
| 75 |
draw z[i]--z[i+1]; |
| 76 |
endfor; |
| 77 |
z[spring_n+2]=z0+(lspring_lt,0); |
| 78 |
pickup pensquare scaled normalline; |
| 79 |
draw z[spring_n+1]--z[spring_n+2]; |
| 80 |
) |
| 81 |
|
| 82 |
%% MASS single/double |
| 83 |
|
| 84 |
dmass_lt#= 2CIu#; |
| 85 |
mass_r#= 1.5CIu#; |
| 86 |
define_whole_pixels(dmass_lt,mass_r); |
| 87 |
|
| 88 |
twopinchar("fdmass")("m")("mass with two forces; full drawn") |
| 89 |
(dmass_lt#, .5mass_r#, .5mass_r#) |
| 90 |
( pickup pensquare scaled normalline; |
| 91 |
z0=(0,0); |
| 92 |
z1=z0+(dmass_lt,0); |
| 93 |
shiftpoint:=z1; |
| 94 |
draw z0--z1; |
| 95 |
z2=.5[z0,z1]; |
| 96 |
pickup pencircle scaled mass_r; |
| 97 |
drawdot z2; |
| 98 |
) |
| 99 |
|
| 100 |
twopinchar("dmass")("m")("mass with two forces; outlined") |
| 101 |
(dmass_lt#, .5mass_r#, .5mass_r#) |
| 102 |
( pickup pensquare scaled normalline; |
| 103 |
z0=(0,0); |
| 104 |
z1=z0+(.5(dmass_lt-mass_r),0); |
| 105 |
draw z0--z1; |
| 106 |
z3=z0+(dmass_lt,0); |
| 107 |
shiftpoint:=z3; |
| 108 |
z4=z3-(.5(dmass_lt-mass_r),0); |
| 109 |
draw z3--z4; |
| 110 |
z2=.5[z0,z3]; |
| 111 |
pickup pencircle scaled normalline; |
| 112 |
draw fullcircle scaled mass_r shifted z2; |
| 113 |
) |
| 114 |
|
| 115 |
twopincharfour("fmass")("m")(".")("*")("mass; full drawn") |
| 116 |
(dmass_lt#, .5mass_r#, .5mass_r#) |
| 117 |
( pickup pensquare scaled normalline; |
| 118 |
z0=(0,0); |
| 119 |
z1=z0+(dmass_lt,0); |
| 120 |
z2=.5[z0,z1]; |
| 121 |
draw z0--z2; |
| 122 |
pickup pencircle scaled mass_r; |
| 123 |
drawdot z2; |
| 124 |
|
| 125 |
shiftpoint:=z1; |
| 126 |
) |
| 127 |
|
| 128 |
twopincharfour("mass")("m")(".")("*")("mass; outlined") |
| 129 |
(dmass_lt#, .5mass_r#, .5mass_r#) |
| 130 |
( pickup pensquare scaled normalline; |
| 131 |
z0=(0,0); |
| 132 |
z1=z0+(.5(dmass_lt-mass_r),0); |
| 133 |
draw z0--z1; |
| 134 |
z3=z0+(dmass_lt,0); |
| 135 |
z2=.5[z0,z3]; |
| 136 |
pickup pencircle scaled normalline; |
| 137 |
draw fullcircle scaled mass_r shifted z2; |
| 138 |
|
| 139 |
shiftpoint:=z3; |
| 140 |
) |
| 141 |
|
| 142 |
%% WALL |
| 143 |
|
| 144 |
wall_lt#= 1.5CIu#; |
| 145 |
wall_ht#= 2.5CIu#; |
| 146 |
define_whole_pixels(wall_ht, wall_lt); |
| 147 |
wall_f=1/3; |
| 148 |
wall_n=6; |
| 149 |
wall_alpha=40; |
| 150 |
|
| 151 |
twopincharfour("wall")("{}")(".")("|")("wall") |
| 152 |
(wall_lt#,.5wall_ht# |
| 153 |
+wall_lt#*(1-wall_f)*sind(wall_alpha),.5wall_ht#) |
| 154 |
( pickup pensquare scaled normalline; |
| 155 |
z0=(0,0); |
| 156 |
z1=z0+(wall_f*wall_lt,0); |
| 157 |
draw z0--z1; |
| 158 |
z1=.5[z2,z3]; y3-y2=wall_ht; x3=x2; |
| 159 |
pickup pensquare scaled verythickline; |
| 160 |
draw z2--z3; |
| 161 |
path a; |
| 162 |
a=(0,0)--(1-wall_f)*wall_lt*dir(wall_alpha); |
| 163 |
pickup pencircle scaled normalline; |
| 164 |
for i:=0 upto wall_n: draw a shifted (i/wall_n)[z2,z3]; endfor |
| 165 |
|
| 166 |
shiftpoint:=z0+(wall_lt,0); |
| 167 |
) |
| 168 |
|
| 169 |
tile_lt#= 2CIu#; |
| 170 |
tile_ht#= .4CIu#; |
| 171 |
tile_f=0.1; |
| 172 |
|
| 173 |
define_whole_pixels(tile_lt,tile_ht); |
| 174 |
|
| 175 |
twopincharfour("tile")("{}")(".")("*")("tile") |
| 176 |
(wall_lt#,.5tile_ht#,.5tile_ht#) |
| 177 |
( pickup pensquare scaled normalline; |
| 178 |
z0=(0,0); |
| 179 |
z1=z0+(tile_lt,0); |
| 180 |
z2=tile_f[z0,z1]; |
| 181 |
draw z0--z1; |
| 182 |
pickup pensquare scaled verythickline; |
| 183 |
draw z1--z2; |
| 184 |
shiftpoint:=z1; |
| 185 |
) |
| 186 |
|
| 187 |
spin_lt#= 2CIu#; |
| 188 |
spin_r#= .7CIu#; |
| 189 |
spin_ht#= 2CIu#; |
| 190 |
spin_alt= .5CIu; |
| 191 |
spin_awd= .1CIu; |
| 192 |
define_whole_pixels(spin_lt,spin_r, spin_ht); |
| 193 |
|
| 194 |
twopinchar("spinu")("S")("spin up") |
| 195 |
(spin_lt#, .6spin_ht#, .6spin_ht#) |
| 196 |
( pickup pensquare scaled normalline; |
| 197 |
z0=(0,0); |
| 198 |
z1=z0+(spin_lt,0); |
| 199 |
draw z0--z1; |
| 200 |
z2=.5[z0,z1]; |
| 201 |
y3-y4=spin_ht; |
| 202 |
x3=x4=x2; |
| 203 |
y2=.6[y3,y4]; |
| 204 |
y5=y6=y3-spin_alt; |
| 205 |
x5=x2-spin_awd; |
| 206 |
x6=x2+spin_awd; |
| 207 |
draw z3--z4; |
| 208 |
filldraw z5--z3--z6--cycle; |
| 209 |
pickup pencircle scaled spin_r; |
| 210 |
drawdot z2; |
| 211 |
shiftpoint:=z1; |
| 212 |
) |
| 213 |
|
| 214 |
twopinchar("spind")("S")("spin down") |
| 215 |
(spin_lt#, .6spin_ht#, .6spin_ht#) |
| 216 |
( pickup pensquare scaled normalline; |
| 217 |
z0=(0,0); |
| 218 |
z1=z0+(spin_lt,0); |
| 219 |
draw z0--z1; |
| 220 |
z2=.5[z0,z1]; |
| 221 |
y3-y4=-spin_ht; |
| 222 |
x3=x4=x2; |
| 223 |
y2=.6[y3,y4]; |
| 224 |
y5=y6=y3+spin_alt; |
| 225 |
x5=x2-spin_awd; |
| 226 |
x6=x2+spin_awd; |
| 227 |
draw z3--z4; |
| 228 |
filldraw z5--z3--z6--cycle; |
| 229 |
pickup pencircle scaled spin_r; |
| 230 |
drawdot z2; |
| 231 |
shiftpoint:=z1; |
| 232 |
) |
| 233 |
|
| 234 |
endCIRCfont |
| 235 |
%% |
| 236 |
%% |
| 237 |
%% End of file `ciphysic.mf'. |