| 1 |
% photorefer.mp |
| 2 |
% L. Nobre G. |
| 3 |
% 2006 |
| 4 |
|
| 5 |
input featpost3Dplus2D; |
| 6 |
|
| 7 |
%\usepackage{beton,concmath,ccfonts} |
| 8 |
|
| 9 |
verbatimtex \documentclass{article} \begin{document} etex |
| 10 |
|
| 11 |
f := ( 6, 5, 2.5 ); |
| 12 |
Spread := 160; |
| 13 |
|
| 14 |
beginfig(2); |
| 15 |
color a, x, b, c, D, y, w, g, h; |
| 16 |
color auxa, auxb, auxc, auxd, auxe, auxf, azz, azy, bzz, bzy; |
| 17 |
pair appear, rpc, rpch, rpcv; |
| 18 |
numeric wid, hei, alfa, beta, forw, back, labscal, framang, lx, ly, verscal; |
| 19 |
pen thedotpen, borderpen, normalpen; |
| 20 |
picture dasha, dashb, labx, laba, labb, labc, labD, labh, labv; |
| 21 |
path outerb, innerb, apath, bpath; |
| 22 |
framang = 0; |
| 23 |
alfa = 0; |
| 24 |
beta = 0; |
| 25 |
% framang = -15; |
| 26 |
% alfa = -20; |
| 27 |
% beta = -15; |
| 28 |
|
| 29 |
wid = 1.5; |
| 30 |
hei = 1; |
| 31 |
forw = 1.5; |
| 32 |
back = 1.5; |
| 33 |
lx = 1.15; |
| 34 |
ly = 0.4; |
| 35 |
verscal = 0.47; |
| 36 |
labscal = 2.8; |
| 37 |
labeloffset := 8pt; |
| 38 |
ahangle := 30; |
| 39 |
ahlength := 10pt; |
| 40 |
b = ( -0.8*back, 0.25*wid, 0.9*hei ); |
| 41 |
c = ( 0, 0.85*wid, 0.35*hei ); |
| 42 |
D = ( cosd( alfa )*cosd( beta ), sind( alfa )*cosd( beta ), sind( beta ) ); |
| 43 |
a = c+0.95*D; |
| 44 |
% a = c+0.7*D; |
| 45 |
labx = btex $\vec{p}$ etex scaled labscal; |
| 46 |
laba = btex $\vec{f}$ etex scaled labscal; |
| 47 |
labb = btex $\vec{R}$ etex scaled labscal; |
| 48 |
labc = btex $\vec{o}$ etex scaled labscal; |
| 49 |
labh = btex $\hat{h}$ etex scaled labscal; |
| 50 |
labv = btex $\hat{v}$ etex scaled labscal; |
| 51 |
thedotpen = pencircle scaled 4pt; |
| 52 |
borderpen = pencircle scaled 2pt; |
| 53 |
normalpen = pencircle scaled 1.5pt; |
| 54 |
dasha = evenly scaled 2; |
| 55 |
% dashb = dashpattern( on 7pt off 5pt on 7pt ); |
| 56 |
dashb = withdots; |
| 57 |
azz = (X(a),Y(a),0); |
| 58 |
azy = (X(a),0,Z(a)); |
| 59 |
bzz = (X(b),Y(b),0); |
| 60 |
bzy = (X(b),0,Z(b)); |
| 61 |
apath = rp(azz)--rp(a)--rp(azy); |
| 62 |
bpath = rp(bzz)--rp(b)--rp(bzy); |
| 63 |
auxa = ( forw, 0, 0 ); |
| 64 |
auxb = ( forw, 0, hei ); |
| 65 |
auxc = ( -back, 0, hei ); |
| 66 |
auxd = ( -back, 0, 0 ); |
| 67 |
auxe = ( -back, wid, 0 ); |
| 68 |
auxf = ( forw, wid, 0 ); |
| 69 |
outerb = rp(auxa)--rp(auxb)--rp(auxc)--rp(auxd)--rp(auxe)--rp(auxf)--cycle; |
| 70 |
draw outerb withpen borderpen; |
| 71 |
draw rp(auxa)--rp(auxd) withpen borderpen; |
| 72 |
|
| 73 |
draw bpath dashed dasha withpen normalpen; |
| 74 |
draw rp(b) withpen thedotpen; |
| 75 |
label.rt( labb, rp(b) ); |
| 76 |
|
| 77 |
draw rp(a)--rp(b) withpen normalpen; |
| 78 |
|
| 79 |
cdotprod( y-c, D ) = 0; |
| 80 |
cdotprod( y-black, green ) = 0; |
| 81 |
cdotprod( y-black, blue ) = 0; |
| 82 |
|
| 83 |
cdotprod( w-c, D ) = 0; |
| 84 |
cdotprod( w-black, green ) = 0; |
| 85 |
cdotprod( w-hei*blue, blue ) = 0; |
| 86 |
|
| 87 |
cdotprod( g-c, D ) = 0; |
| 88 |
cdotprod( g-wid*green, green ) = 0; |
| 89 |
cdotprod( g-hei*blue, blue ) = 0; |
| 90 |
|
| 91 |
cdotprod( h-c, D ) = 0; |
| 92 |
cdotprod( h-wid*green, green ) = 0; |
| 93 |
cdotprod( h-black, blue ) = 0; |
| 94 |
|
| 95 |
innerb = rp(y)--rp(w)--rp(g)--rp(h)--cycle; |
| 96 |
unfill innerb; |
| 97 |
draw innerb withpen borderpen; |
| 98 |
|
| 99 |
draw apath dashed dasha withpen normalpen; |
| 100 |
draw rp(a) withpen thedotpen; |
| 101 |
label.llft( laba, rp(a) ); |
| 102 |
|
| 103 |
x = whatever[a,b]; |
| 104 |
cdotprod( x-c, D ) = 0; |
| 105 |
draw rp(x) withpen thedotpen; |
| 106 |
label.lft( labx, rp(x) ); |
| 107 |
|
| 108 |
draw rp(a)--rp(x) withpen normalpen; |
| 109 |
draw rp(x)--rp(b) withpen normalpen dashed dashb; |
| 110 |
|
| 111 |
draw rp(c) withpen thedotpen; |
| 112 |
draw rp(a)--rp(c) withpen borderpen; |
| 113 |
label.bot( labc, rp(c) ); |
| 114 |
|
| 115 |
numeric theang; |
| 116 |
color perpo, perpa, perph, perpv; |
| 117 |
perpo = N( x-c ); |
| 118 |
perpa = ncrossprod( D, c-x ); |
| 119 |
theang = -getangle( w-y, perpa ); |
| 120 |
perph = perpo*cosd( framang+theang ) + perpa*sind( framang+theang ); |
| 121 |
perpv =-perpo*sind( framang+theang ) + perpa*cosd( framang+theang ); |
| 122 |
color corn, corm; |
| 123 |
numeric coox, cooy; |
| 124 |
coox = cdotprod( x-c, perph ); |
| 125 |
cooy = cdotprod( x-c, perpv ); |
| 126 |
draw rp(c)--rp(c+lx*perph)--rp(c+lx*perph+ly*perpv) |
| 127 |
--rp(c+ly*perpv)--cycle dashed evenly; |
| 128 |
draw rp(c)--rp(c+coox*perph)--rp(c+coox*perph+cooy*perpv) |
| 129 |
--rp(c+cooy*perpv)--cycle dashed evenly; |
| 130 |
rpc = rp(c); |
| 131 |
rpch = rp(c+verscal*perph); |
| 132 |
rpcv = rp(c+verscal*perpv); |
| 133 |
drawarrow rpc--rpch withpen normalpen; |
| 134 |
drawarrow rpc--rpcv withpen normalpen; |
| 135 |
label.rt( labv, rpcv ); |
| 136 |
% label.top( labh, rpch ); |
| 137 |
label.lrt( labh, rpch ); |
| 138 |
endfig; |
| 139 |
|
| 140 |
f := ( 5, 3, 1 ); |
| 141 |
Spread := 70; |
| 142 |
|
| 143 |
beginfig(1); |
| 144 |
labeloffset := 3pt; |
| 145 |
ahangle := 30; |
| 146 |
ahlength := 5pt; |
| 147 |
numeric alpha, beta, gamma, axeslen, blen, angray; |
| 148 |
alpha = 65; |
| 149 |
beta = 70; |
| 150 |
gamma = 75; |
| 151 |
blen = 1.4; |
| 152 |
axeslen = 1.2; |
| 153 |
angray = 0.4; |
| 154 |
orthaxes( axeslen, btex $E$ etex, axeslen, btex $N$ etex, axeslen, btex $Z$ etex ); |
| 155 |
path vo, vh, vv, vhp, vop; |
| 156 |
z0 = rp( black ); |
| 157 |
color po, ph, pv, php, pop; |
| 158 |
pop = ( cosd(alpha), sind(alpha), 0 ); |
| 159 |
po = blen*( cosd(beta)*pop + sind(beta)*blue ); |
| 160 |
php = ( sind(alpha), -cosd(alpha), 0 ); |
| 161 |
numeric hx, hy, hv, vx, vy, vz; |
| 162 |
hx = sind(alpha)*cosd(gamma)-sind(beta)*cosd(alpha)*sind(gamma); |
| 163 |
hy =-cosd(alpha)*cosd(gamma)-sind(beta)*sind(alpha)*sind(gamma); |
| 164 |
hz = cosd(beta)*sind(gamma); |
| 165 |
vx =-sind(alpha)*sind(gamma)-sind(beta)*cosd(alpha)*cosd(gamma); |
| 166 |
vy = cosd(alpha)*sind(gamma)-sind(beta)*sind(alpha)*cosd(gamma); |
| 167 |
vz = cosd(beta)*cosd(gamma); |
| 168 |
ph = ( hx, hy, hz ); |
| 169 |
pv = ( vx, vy, vz ); |
| 170 |
z1 = rp( po ); |
| 171 |
z2 = rp( ph ); |
| 172 |
z3 = rp( pv ); |
| 173 |
z4 = rp( php ); |
| 174 |
z5 = rp( pop ); |
| 175 |
vo = z0--z1; |
| 176 |
vh = z0--z2; |
| 177 |
vv = z0--z3; |
| 178 |
vhp = z0--z4; |
| 179 |
vop = z0--z5; |
| 180 |
drawarrow vo; |
| 181 |
drawarrow vh; |
| 182 |
drawarrow vv; |
| 183 |
draw vhp dashed evenly; |
| 184 |
draw vop dashed evenly; |
| 185 |
squareangline( ph, pv, black, 0.1 ); |
| 186 |
angline( pop, po, black, angray, btex $\beta$ etex, rt ); |
| 187 |
angline( php, ph, black, angray, btex $\gamma$ etex, lft ); |
| 188 |
angline( red, pop, black, angray, btex $\alpha$ etex, bot ); |
| 189 |
label.top( btex $\vec{f}-\vec{o}$ etex, z1 ); |
| 190 |
label.top( btex $\hat{h}$ etex, z2 ); |
| 191 |
label.top( btex $\hat{v}$ etex, z3 ); |
| 192 |
endfig; |
| 193 |
|
| 194 |
verbatimtex |
| 195 |
\end{document} |
| 196 |
etex |
| 197 |
|
| 198 |
end. |