;;;-*-lisp-*- (comment) (progn (load '((gjc)gjc lisp)) (defaultf '((dsk graphs))) (load 'demo) (setq prinlength 7) (setq read-pause-time 0.1) (cursorpos 'c tyo) (format tyo "This is a very short demo of graphics. To get the demo type (DEMO) which invokes the lisp function DEMO defined by this file. What you will see is a sequence of lisp forms which if you typed would have the effect that you see. ") (defun pause () (format tyo "~&-pause-") (cursorpos 'n)) (defun hpause () (cursorpos 'top) (pause)) (setq demo-forms '((or (get 'plot 'version) (load 'plot)) (comment "Set the input and output numeric radix to TEN.") (setq base 10. ibase 10.) (gcall graphic-stream 'open 'dsk '((graphs) demo ards)) (comment "set the number of points.") (setq plotnum 200) (plot (times 3 x (cos (times 4 x)) (sin x)) x -5 5) (hpause) (plot sin -3.1416 3.1416) (pause) (comment "Or you can define a function.") (defun f1 (x) (*$ x x)) (pause) (plot f1 -3 3) (pause) (comment "there is a nice function for making spirals") (defun sp (n m) (draw-spiral graphic-stream 1.5 0.0 0.0 n m)) (comment "use the auto-scaling of PLOT to set up the window.") (pause) (progn (plot x x -1 1) (sp 33 33)) (hpause) (gcall graphic-stream 'cursorpos 'c) (sp 75. 3.) (hpause) (sp 75. 5.) (hpause) (comment " how about some 3d-graphics? ") (or (get 'plot3 'version) (load 'plot3)) (gcall graphic-stream 'set-window -0.8 0.8 -0.8 0.8) (comment "set the euler angles. ") (gcall 3d-stream 'Set-theta -1.0) (gcall 3d-stream 'set-phi 0.1) (gcall 3d-stream 'set-psi 0.4) (gcall graphic-stream 'cursorpos 'c) (mobius 100 2) (hpause) (torus 100 10) (gcall graphic-stream 'close 'dsk) (comment "that is all. enjoy!"))) '*)