$SPAD/src/input plotlist.input

The Axiom Team December 3, 2016

Abstract

Contents

2

1 License

— license —

--Copyright The Numerical Algorithms Group Limited 1996.

———-

— * —

)clear all
\getchunk{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)

———-

References^{[1] nothing}

4