2005-10-18 17:42:20sjgau

新版的 Plot a SIN- Curve LISP 程式

; this is a comment

;|
this is the block comment
can over server lines
|;

(textscr)
; we will plot a sine- curve, from 0 - 360, t1 - t2
; step dt

; dt= (t2 - t1)/no
; no= ?

(setq no (getint "Please input a number(100 - 300) for test: "))
(setq t1 0.0 t2 360.0)
(setq dt (/ (- t2 t1) no))

(command "blipmode" "off")
(setvar "cmdecho" 0)

(graphscr)
(command "PLine")

; for tt= t1 to t2 step dt do ...
(setq t2 (+ t2 (/ dt 10.0)))
(setq tt t1)
(while (<= tt t2)
(setq x (* (/ tt 180.0) pi))
(setq y (sin x))
(setq p1 (list x y))

(command p1)
(setq tt (+ tt dt))
); end of while()
(command "")

(princ); end of the file