| 1 |
verbatimtex |
| 2 |
\documentclass{article} |
| 3 |
\usepackage{palatino} |
| 4 |
\usepackage{concmath} |
| 5 |
\usepackage{ccfonts} |
| 6 |
\begin{document} |
| 7 |
etex |
| 8 |
|
| 9 |
%prologues := 2; |
| 10 |
|
| 11 |
|
| 12 |
vardef trigonometry(expr ct)= |
| 13 |
|
| 14 |
save z, p, m, pic; |
| 15 |
numeric m; |
| 16 |
pair z[]; |
| 17 |
path p[]; |
| 18 |
picture pic; |
| 19 |
|
| 20 |
pic := nullpicture; |
| 21 |
m := if (xpart ct) > (ypart ct): ypart ct else: xpart ct fi; |
| 22 |
|
| 23 |
p0 = unitsquare xscaled (xpart ct) yscaled (ypart ct); |
| 24 |
p3 = origin--ct; |
| 25 |
p2 = (m,0)--(m,m)--(0,m); |
| 26 |
p1 = (m,0){up}..{left}(0,m); |
| 27 |
|
| 28 |
z0 = origin; |
| 29 |
z2 = point 0 of p2; |
| 30 |
z5 = point 2 of p2; |
| 31 |
z6 = ct; |
| 32 |
z3 = p1 intersectionpoint p3; |
| 33 |
z4 = p2 intersectionpoint p3; |
| 34 |
z1 = (xpart z3, 0); |
| 35 |
|
| 36 |
p4 = z1--z3; |
| 37 |
m := xpart (p2 intersectiontimes p3); |
| 38 |
if m <= 1: |
| 39 |
p5 = z2--z4; |
| 40 |
p6 = z5--z6; |
| 41 |
else: |
| 42 |
p5 = z5--z4; |
| 43 |
p6 = z2--z6; |
| 44 |
fi; |
| 45 |
|
| 46 |
m := top(0)-bot(0); |
| 47 |
|
| 48 |
for i=0 upto 4: |
| 49 |
addto pic doublepath p[i] withpen pencircle scaled (m/3); |
| 50 |
endfor; |
| 51 |
for i=3 upto 6: |
| 52 |
addto pic doublepath p[i] withpen pencircle scaled m; |
| 53 |
endfor; |
| 54 |
|
| 55 |
for i=0 upto 6: |
| 56 |
addto pic doublepath z[i] withpen pencircle scaled 3m; |
| 57 |
endfor; |
| 58 |
|
| 59 |
addto pic also thelabel.llft(btex \strut $a$ etex , z0); |
| 60 |
addto pic also thelabel.bot(btex \strut $b$ etex, z1); |
| 61 |
addto pic also thelabel.bot(btex \strut $c$ etex, z2); |
| 62 |
addto pic also thelabel.lft(btex $d$ etex, z3); |
| 63 |
addto pic also thelabel.ulft(btex $e$ etex, z4); |
| 64 |
addto pic also thelabel.lft(btex \strut $f$ etex, z5); |
| 65 |
addto pic also thelabel.rt(btex \strut $g$ etex, z6); |
| 66 |
|
| 67 |
pic |
| 68 |
enddef; |
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
beginfig(1); |
| 74 |
|
| 75 |
pickup pencircle scaled .6pt; |
| 76 |
|
| 77 |
draw trigonometry((6cm,3cm)); |
| 78 |
draw trigonometry((3cm,6cm))shifted (7cm,0); |
| 79 |
|
| 80 |
endfig; |
| 81 |
verbatimtex |
| 82 |
\end{document} |
| 83 |
etex |
| 84 |
end |