AutoLISP for plot-sin
(高顯忠, sjgau4311@gmail.com, 2012-04-19 15:36)
1樓
; file: plot-sin.lsp
; y= sin(x), x= 0 to pi
(setq x1 0.0 x2 pi no 16
dx (/ (- x2 x1) no))
; for x= x1 to x2 step dx do ...
(setq x x1 x2 (+ x2 (/ dx 10.0)))
(command "spline")
(while (<= x x2)
(setq y (sin x))
(command (list x y))
(setq x (+ x dx))
); end of while()
(command "" "" "")
; end of file