| 1 |
% magneticflux.mp |
| 2 |
% L. Nobre G. |
| 3 |
% IYP (2005) |
| 4 |
|
| 5 |
input featpost3Dplus2D; |
| 6 |
|
| 7 |
verbatimtex |
| 8 |
\documentclass{article} |
| 9 |
\usepackage{palatino,mathpazo} |
| 10 |
\begin{document} |
| 11 |
etex |
| 12 |
|
| 13 |
TDAtiplen := 0.1; % tdarrow |
| 14 |
TDAhalftipbase := 0.04; % Three-Dimensional |
| 15 |
TDAhalfthick := 0.02; % Arrow |
| 16 |
ForePen := pencircle scaled 10pt; |
| 17 |
BackPen := pencircle scaled 6pt; |
| 18 |
|
| 19 |
numeric ranga; |
| 20 |
ranga = 30+uniformdeviate(120); |
| 21 |
|
| 22 |
def ellip( expr TheVal ) = |
| 23 |
( (cosd(360*TheVal),sind(360*TheVal)/sind(ranga),0) ) |
| 24 |
enddef; |
| 25 |
|
| 26 |
beginfig(2); |
| 27 |
f := ( 4, 1, 2 ); |
| 28 |
Spread := 90; |
| 29 |
pen blackpen, whitepen; |
| 30 |
numeric majoraxe, i, j, gridstepn, gridstep, gridstart, halen, rang; |
| 31 |
numeric ellfocus, totdist, marginl; |
| 32 |
path espira, partes, covere; |
| 33 |
color avec, midvec; |
| 34 |
halen = 1; |
| 35 |
marginl = 0.14; |
| 36 |
rang = 45+30*floor(uniformdeviate(3.9)); |
| 37 |
show rang; |
| 38 |
avec = (0,cosd(rang),sind(rang))*halen; |
| 39 |
blackpen = pencircle scaled 5pt; |
| 40 |
whitepen = pencircle scaled 3pt; |
| 41 |
majoraxe = 1.2 + uniformdeviate(0.8); |
| 42 |
ellfocus = majoraxe +-+ 1; |
| 43 |
gridstepn= 15; |
| 44 |
gridstep = 2*majoraxe/(gridstepn-1); |
| 45 |
gridstart= 0.5*gridstepn*gridstep; |
| 46 |
espira = ellipticpath( black, -red, -green*majoraxe ); |
| 47 |
draw espira withpen blackpen; |
| 48 |
undraw espira withpen whitepen; |
| 49 |
for j=-1 step gridstep until 1: |
| 50 |
for i=-gridstart step gridstep until gridstart: |
| 51 |
midvec := (j,i,0); |
| 52 |
totdist := conorm(midvec-(0,-ellfocus,0))+conorm(midvec-(0,ellfocus,0)); |
| 53 |
if 2*majoraxe-marginl > totdist: |
| 54 |
tdarrow( midvec, midvec+avec ); |
| 55 |
% draw rp(midvec) withpen whitepen; |
| 56 |
fi; |
| 57 |
endfor; |
| 58 |
endfor; |
| 59 |
partes = subpath (10.3,25.6) of espira; |
| 60 |
covere = subpath (10,26) of espira; |
| 61 |
draw partes withpen blackpen; |
| 62 |
undraw covere withpen whitepen; |
| 63 |
endfig; |
| 64 |
|
| 65 |
beginfig(1); |
| 66 |
f := ( 4, 1.9, 1.22 ); |
| 67 |
Spread := 90; |
| 68 |
numeric nodc, lsc; |
| 69 |
nodc = 10; |
| 70 |
lsc = 2.4; |
| 71 |
closedline( true, 200, 0.5, 1.75 )( ellip ); |
| 72 |
numeric i, j, circlesize, polar, phi; |
| 73 |
color currpos, ini, fin, avec; |
| 74 |
string comm; |
| 75 |
avec = (0,cosd(ranga),sind(ranga)); |
| 76 |
circlesize = 1.86/nodc; |
| 77 |
for i=0.93 step -circlesize until 0.4*circlesize: |
| 78 |
polar := floor(6.28318*i/circlesize); |
| 79 |
for j=1 upto polar: |
| 80 |
phi := 360*j/polar; |
| 81 |
currpos := i*(cosd(phi),sind(phi)/sind(ranga),0); |
| 82 |
comm:="tdarrow(" |
| 83 |
& cstr( currpos ) |
| 84 |
& "," |
| 85 |
& cstr( currpos + avec ) |
| 86 |
& ");"; |
| 87 |
getready( comm, currpos ); |
| 88 |
endfor; |
| 89 |
endfor; |
| 90 |
doitnow; |
| 91 |
pickup pencircle scaled 2pt; |
| 92 |
drawarrow rp((0,1.07/sind(ranga),0))--rp((0,2.47,0)); |
| 93 |
drawarrow rp((1.07,0,0))--rp((1.67,0,0)); |
| 94 |
angline((0,2.37,0),(0,0.93/sind(ranga),0)+avec,(0,0.93/sind(ranga),0), |
| 95 |
0.3, btex $\alpha$ etex scaled lsc, urt); |
| 96 |
label.bot( btex $x$ etex scaled lsc, rp((1.67,0,0)) ); |
| 97 |
label.bot( btex $y$ etex scaled lsc, rp((0,2.47,0)) ); |
| 98 |
endfig; |
| 99 |
|
| 100 |
|
| 101 |
verbatimtex |
| 102 |
\end{document} |
| 103 |
etex |
| 104 |
|
| 105 |
end. |