aboutsummaryrefslogtreecommitdiff
path: root/src/input/mult2d.input.pamphlet
diff options
context:
space:
mode:
Diffstat (limited to 'src/input/mult2d.input.pamphlet')
-rw-r--r--src/input/mult2d.input.pamphlet56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/input/mult2d.input.pamphlet b/src/input/mult2d.input.pamphlet
new file mode 100644
index 00000000..0a3526a8
--- /dev/null
+++ b/src/input/mult2d.input.pamphlet
@@ -0,0 +1,56 @@
+\documentclass{article}
+\usepackage{axiom}
+\begin{document}
+\title{\$SPAD/src/input mult2d.input}
+\author{The Axiom Team}
+\maketitle
+\begin{abstract}
+\end{abstract}
+\eject
+\tableofcontents
+\eject
+\section{License}
+<<license>>=
+--Copyright The Numerical Algorithms Group Limited 1994.
+@
+<<*>>=
+<<license>>
+)clear all
+
+--draws x**i for i in 1..5, x=-1..1
+
+makePoint(x:SF,y:SF):(Point SF) ==
+ point([x,y])$(Point SF)
+
+drawFun(fn:SF->SF, seg:Segment Float):List(List(Point SF)) ==
+ fp := (t:SF):Point SF +-> makePoint(t, fn(t))
+ plot := pointPlot(fp, segment(convert(lo seg)@SF, convert(hi seg)@SF))$PLOT
+ lp := listBranches(plot)$PLOT
+
+drawFuns(fl:List(SF->SF), seg:SegmentBinding Float):VIEW2D ==
+ v := viewport2D()$VIEW2D
+ i : PositiveInteger := 1
+ for f in fl repeat
+ llp := drawFun(f, segment seg)
+ g := graphCurves(llp)$VIEW
+ putGraph(v,g,i)$VIEW2D
+ i := i + 1
+ makeViewport2D(v)$VIEW2D
+
+makeListFuns(fl:List(Expression Integer),_
+ seg:SegmentBinding Float):List(SF->SF) ==
+ lfuns:List(SF->SF) := empty()
+ for f in fl repeat
+ ff : (SF->SF) := makeFloatFunction(f, variable seg)$MakeFloatCompiledFunction(Expression Integer)
+ lfuns := cons(ff, lfuns)
+ lfuns
+
+drawFuns(makeListFuns([x**i for i in 1..5], x=-1..1), x=-1..1)
+drawFuns(makeListFuns([sin(x*i) for i in 1..5], x=-1..1), x=-1..1)
+drawFuns(makeListFuns([sec x, sin x, cos x, tan x], x=-1..1), x=-1..1)
+@
+\eject
+\begin{thebibliography}{99}
+\bibitem{1} nothing
+\end{thebibliography}
+\end{document}