Periodically I feel the need to call attention to Turtle Graphics as a versatile graphic tool in Run Rev.

There has been recent discussions on the list about drawing a graph. The following script will draw a simple graph:

on mouseUp
  startTurtle --Initialize turtle graphics
  put 0,30,120,20, 40 ,22, 104, 210 into tYdata
  put 20 into dx
  drawCoorAxes
  put 0 into x
  repeat with i = 1 to the number of items in tYdata
    setxy x,item i of tYdata
    add dx to x
  end repeat
  choose the browse tool
end mouseUp

on drawCoorAxes
  forward 200
  back 200
  left 90
  forward 200
  back 200
end drawCoorAxes

With a simple change one could plot any analytic function, f(x)
As well as a vertical and horizontal mesh.
Jim Hurley
_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to