| 1 |
% trigonometry.mp |
| 2 |
% L. Nobre G. |
| 3 |
% 2002 |
| 4 |
|
| 5 |
% %input mp-tool; |
| 6 |
|
| 7 |
verbatimtex |
| 8 |
\documentclass{article} |
| 9 |
\usepackage{palatino} |
| 10 |
\usepackage{concmath} |
| 11 |
\usepackage{ccfonts} |
| 12 |
\begin{document} |
| 13 |
etex |
| 14 |
|
| 15 |
def PickColor = |
| 16 |
( uniformdeviate(1) , uniformdeviate(1), 0 ) |
| 17 |
enddef; |
| 18 |
|
| 19 |
beginfig(1); |
| 20 |
picture sin, cos, tan, ctg, sec, csc; |
| 21 |
color sincol, coscol, tancol, ctgcol, seccol, csccol; |
| 22 |
pair sinl, cosl, tanl, ctgl, secl, cscl; |
| 23 |
path sinp, cosp, tanp, ctgp, secp; |
| 24 |
numeric Ang, U, len, labelscale; |
| 25 |
path diag, fram, quar; |
| 26 |
pair urc, ulc, lrc, tgc, sic, coc, btg; |
| 27 |
pen basepen, thikpen, thinpen; |
| 28 |
Ang = 21; % Ang < 45 |
| 29 |
U = 1.8in; |
| 30 |
labelscale = 2; |
| 31 |
basepen = pencircle scaled 1.2pt; |
| 32 |
thikpen = pencircle scaled 3.4pt; |
| 33 |
thinpen = pencircle scaled 1.2pt; |
| 34 |
sincol = PickColor; |
| 35 |
coscol = PickColor; |
| 36 |
tancol = PickColor; |
| 37 |
ctgcol = PickColor; |
| 38 |
seccol = PickColor; |
| 39 |
csccol = PickColor; |
| 40 |
len = U * cosd( Ang ) / sind( Ang ); |
| 41 |
urc = ( len, U ); |
| 42 |
ulc = ( 0, U ); |
| 43 |
lrc = ( len, 0 ); |
| 44 |
tgc = ( U, U * sind( Ang ) / cosd( Ang ) ); |
| 45 |
sic = ( U * cosd( Ang ), U * sind( Ang ) ); |
| 46 |
coc = ( U * cosd( Ang ), 0 ); |
| 47 |
btg = ( U, 0 ); |
| 48 |
diag = origin--urc; |
| 49 |
fram = origin--lrc--urc--ulc--cycle; |
| 50 |
quar = halfcircle cutafter ( origin--up ); |
| 51 |
quar := quar scaled 2U; |
| 52 |
draw fram withpen basepen; |
| 53 |
draw quar withpen basepen; |
| 54 |
sinl = 0.5[coc,sic]; |
| 55 |
sinp = coc--sic; |
| 56 |
cosl = 0.5[origin,coc]; |
| 57 |
cosp = origin--coc; |
| 58 |
tanl = 0.5[btg,tgc]; |
| 59 |
tanp = btg--tgc; |
| 60 |
ctgl = 0.5[ulc,urc]; |
| 61 |
ctgp = ulc--urc; |
| 62 |
secl = 0.5[origin,sic]; |
| 63 |
secp = origin--tgc; |
| 64 |
cscl = 0.5[origin,urc]; |
| 65 |
draw diag withcolor csccol withpen thikpen; |
| 66 |
draw secp withcolor seccol withpen thinpen; |
| 67 |
draw ctgp withcolor ctgcol withpen thinpen; |
| 68 |
draw tanp withcolor tancol withpen thinpen; |
| 69 |
draw cosp withcolor coscol withpen thinpen; |
| 70 |
draw sinp withcolor sincol withpen thinpen; |
| 71 |
sin = thelabel.lft( btex sin etex scaled labelscale, sinl ); |
| 72 |
cos = thelabel.top( btex cos etex scaled labelscale, cosl ); |
| 73 |
tan = thelabel.rt( btex tan etex scaled labelscale, tanl ); |
| 74 |
ctg = thelabel.bot( btex cotan etex scaled labelscale, ctgl ); |
| 75 |
sec = thelabel.top( btex sec etex scaled labelscale, origin ); |
| 76 |
csc = thelabel.top( btex cosec etex scaled labelscale, origin ); |
| 77 |
draw sin withcolor sincol; |
| 78 |
draw cos withcolor coscol; |
| 79 |
draw tan withcolor tancol; |
| 80 |
draw ctg withcolor ctgcol; |
| 81 |
draw sec rotated Ang shifted secl withcolor seccol; |
| 82 |
draw csc rotated Ang shifted cscl withcolor csccol; |
| 83 |
endfig; |
| 84 |
|
| 85 |
verbatimtex |
| 86 |
\end{document} |
| 87 |
etex |
| 88 |
|
| 89 |
end. |