aboutsummaryrefslogtreecommitdiff
path: root/src/input/drawcx.input.pamphlet
blob: 726cb3314e5db0135faba998f6e329036fc082c1 (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
\documentclass{article}
\usepackage{axiom}
\begin{document}
\title{\$SPAD/src/input drawcx.input}
\author{The Axiom Team}
\maketitle
\begin{abstract}
\end{abstract}
\eject
\tableofcontents
\eject
\section{License}
<<license>>=
--Copyright The Numerical Algorithms Group Limited 1991.
@
<<*>>=
<<license>>
)clear all

--Plotting Two Dimensional Compiled Functions of One Variable
f(x:DFLOAT):DFLOAT == sin(tan(x))-tan(sin(x))
draw(f,0..6)
draw(f,0..6,unit == [1.0,0.5],toScale == true)

--Plotting Two Dimensional Compiled Parametric Plane Curve Functions
i1(t:DFLOAT):DFLOAT == 9*sin(3*t/4)
i2(t:DFLOAT):DFLOAT == 8*sin(t)
draw(curve(i1,i2),-4*%pi..4*%pi)
draw(curve(i1,i2),-4*%pi..4*%pi,toScale == true, title == "Lissajous Curve")

--Plotting Three Dimensional Compiled Parametric Space Curve Functions
i1(t:DFLOAT):DFLOAT ==sin(t)*cos(3*t/5)
i2(t:DFLOAT):DFLOAT ==cos(t)*cos(3*t/5)
i3(t:DFLOAT):DFLOAT ==cos(t)*sin(3*t/5)
draw(curve(i1,i2,i3),0..15*%pi)
draw(curve(i1,i2,i3),0..15*%pi,title == "Parametric Curve")

--Plotting Three Dimensional Compiled Functions of Two Variables
l(x:DFLOAT,y:DFLOAT):DFLOAT == cos(x*y)
draw(l,-3..3,-3..3)
colorFxn(x:DFLOAT,y:DFLOAT):DFLOAT == 1/(x**2 + y**2 + 1)
draw(l,-3..3,-3..3, colorFunction == colorFxn)

--Plotting Three Dimensional Compiled Parametric Surface Functions
n1(u:DFLOAT,v:DFLOAT):DFLOAT == u*cos(v)
n2(u:DFLOAT,v:DFLOAT):DFLOAT == u*sin(v)
n3(u:DFLOAT,v:DFLOAT):DFLOAT == v*cos(u)
draw(surface(n1,n2,n3),-4..4,0..2*%pi)
colorFxn(x:DFLOAT,y:DFLOAT):DFLOAT == 1/(x**2 + y**2 + 1)
draw(surface(n1,n2,n3),-4..4,0..2*%pi, colorFunction == colorFxn)

@
\eject
\begin{thebibliography}{99}
\bibitem{1} nothing
\end{thebibliography}
\end{document}