知識社群登入
位置: AutoCAD開放式教學 > 討論區 > 討論
y= sin(x)
1樓
; for x= 0 to pi step dx do ...

(setq no 16)

(setq x1 0.0 x2 pi 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 "" "" "")
(princ)


附件
1. PLOT-SIN.LSP (1 KB)