aboutsummaryrefslogtreecommitdiff
path: root/src/input/drawcfn.input.pamphlet
blob: 98a682e2994adb0e1322eb5b8f130468e302df8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
\documentclass{article}
\usepackage{axiom}
\begin{document}
\title{\$SPAD/src/input drawcfn.input}
\author{The Axiom Team}
\maketitle
\begin{abstract}
\end{abstract}
\eject
\tableofcontents
\eject
<<*>>=
 
-- Two dimensional function plots

f(x:SF):SF == sin(11*x)
draw(f,0..2*%pi)
draw(f,0..2*%pi,adaptive == false,title == "Non-adaptive plot")
draw(f,0..2*%pi,toScale == true,title == "Drawn to scale")
draw(f,0..2*%pi,coordinates == polar,title == "Polar plot")

g(x:SF):SF == tan(x)
draw(g,-6..6,title == "Clipping on")
draw(g,-6..6,clip == false,title == "Clipping off")

-- Parametric plane curves

f1(t:SF):SF == 9*sin(3*t/4)
f2(t:SF):SF == 8*sin(t)
draw(curve(f1,f2),-4*%pi..4*%pi,toScale == true,title == "Lissajous curve")

g1(t:SF):SF == sin(5*t)
g2(t:SF):SF == t
draw(curve(g1,g2),0..2*%pi,title == "Parametric curve")
draw(curve(g1,g2),0..2*%pi,_
           coordinates == polar,title == "Parametric polar curve")

h1(t:SF):SF == t
h2(t:SF):SF == 2
draw(curve(h1,h2),-3..3,coordinates == parabolic,title == "Parabolic plot")

-- Parametric space curves

i1(t:SF):SF == sin(t)*cos(3*t/5)
i2(t:SF):SF == cos(t)*cos(3*t/5)
i3(t:SF):SF == cos(t)*sin(3*t/5)
draw(curve(i1,i2,i3),0..15*%pi,title == "Parametric curve")
draw(curve(i1,i2,i3),0..15*%pi,tubeRadius == .15,title == "Tube around curve")

j1(t:SF):SF == 4
j2(t:SF):SF == t
draw(curve(j1,j2,j2),-9..9,coordinates == cylindrical,title == "Spiral")

k1(t:SF):SF == 1
k2(t:SF):SF == t/7
k3(t:SF):SF == t/5
draw(curve(k1,k2,k3),-70*%pi..70*%pi,coordinates == spherical,_
           title == "Gnarly curve on sphere")

-- Three dimensional function plots

l(x:SF,y:SF):SF == cos(x*y)
draw(l,-3..3,-3..3)

colorFunction1(x:SF,y:SF):SF == x
draw(l,-3..3,-3..3,colorFunction == colorFunction1)

colorFunction2(x:SF,y:SF):SF == x**2 + y**2
draw(l,-3..3,-3..3,colorFunction == colorFunction2)

colorFunction3(x:SF,y:SF,z:SF):SF == -z
draw(l,-3..3,-3..3,colorFunction == colorFunction3)

m(u:SF,v:SF):SF == 1
draw(m,0..2*%pi,0..%pi,coordinates == spherical,title == "Sphere")
draw(m,0..2*%pi,0..%pi,coordinates == spherical,_
           colorFunction == colorFunction2,title == "Sphere")

draw(m,-%pi/2..%pi/2,0..2*%pi,coordinates == oblateSpheroidal(1$SF),_
           title == "Oblate spheroidal coordinates")

-- Parametric surfaces

n1(u:SF,v:SF):SF == 5*sin(u)*cos(v)
n2(u:SF,v:SF):SF == 4*sin(u)*sin(v)
n3(u:SF,v:SF):SF == 3*cos(u)
draw(surface(n1,n2,n3),0..%pi,0..2*%pi,title == "Which came first?")
@
\eject
\begin{thebibliography}{99}
\bibitem{1} nothing
\end{thebibliography}
\end{document}