aboutsummaryrefslogtreecommitdiff
path: root/src/input/plotlist.input.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2007-08-14 05:14:52 +0000
committerdos-reis <gdr@axiomatics.org>2007-08-14 05:14:52 +0000
commitab8cc85adde879fb963c94d15675783f2cf4b183 (patch)
treec202482327f474583b750b2c45dedfc4e4312b1d /src/input/plotlist.input.pamphlet
downloadopen-axiom-ab8cc85adde879fb963c94d15675783f2cf4b183.tar.gz
Initial population.
Diffstat (limited to 'src/input/plotlist.input.pamphlet')
-rw-r--r--src/input/plotlist.input.pamphlet57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/input/plotlist.input.pamphlet b/src/input/plotlist.input.pamphlet
new file mode 100644
index 00000000..7dd581ef
--- /dev/null
+++ b/src/input/plotlist.input.pamphlet
@@ -0,0 +1,57 @@
+\documentclass{article}
+\usepackage{axiom}
+\begin{document}
+\title{\$SPAD/src/input plotlist.input}
+\author{The Axiom Team}
+\maketitle
+\begin{abstract}
+\end{abstract}
+\eject
+\tableofcontents
+\eject
+\section{License}
+<<license>>=
+--Copyright The Numerical Algorithms Group Limited 1996.
+@
+<<*>>=
+)clear all
+<<license>>
+
+--draws x**i for i in 1..5, x=-1..1
+
+makePoint(x:DoubleFloat,y:DoubleFloat):(Point DoubleFloat) ==
+ point(l :List DoubleFloat := [x,y])$(Point DoubleFloat)
+
+drawFun(fn:DoubleFloat->DoubleFloat, seg:Segment Float):List(List(Point DoubleFloat)) ==
+ fp := (t:DoubleFloat):Point DoubleFloat +-> makePoint(t, fn(t))
+ plot := pointPlot(fp, segment(convert(lo seg)@DoubleFloat, convert(hi seg)@DoubleFloat))$PLOT
+ lp := listBranches(plot)$PLOT
+
+drawFuns(fl:List(DoubleFloat->DoubleFloat), seg:SegmentBinding Float):VIEW2D ==
+ v := viewport2D()$VIEW2D
+ i : PositiveInteger := 1
+ for f in fl repeat
+ g := graphImage()$GRIMAGE
+ s : Segment Float := segment seg
+ llp : List(List(Point DoubleFloat)) := drawFun(f, s)
+ g :GRIMAGE := graphCurves(llp)$VIEW
+ putGraph(v,g,i)$VIEW2D
+ i := i + 1
+ makeViewport2D(v)$VIEW2D
+
+makeListFuns(fl:List(Expression Integer),_
+ seg:SegmentBinding Float):List(DoubleFloat->DoubleFloat) ==
+ lfuns:List(DoubleFloat->DoubleFloat) := empty()
+ for f in fl repeat
+ ff : (DoubleFloat->DoubleFloat) := 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)
+
+@
+\eject
+\begin{thebibliography}{99}
+\bibitem{1} nothing
+\end{thebibliography}
+\end{document}