2005-10-12 13:54:41sjgau
叫AutoCAD 畫sin-curve 的程式
; for theta=0 to 360 step dt do
(setq no 100)
(setq theta 0.0 dt (/ 360.0 no))
(setq dt (+ dt (/ dt 10.0)))
(setvar "cmdEcho" 0)
(command "pline")
(while (<= theta 360.0)
(setq t1 (* (/ theta 180.0) pi))
(setq y1 (sin t1))
(command (list t1 y1))
(setq theta (+ theta dt))
); end of while()
(command "")
(princ)
(setq no 100)
(setq theta 0.0 dt (/ 360.0 no))
(setq dt (+ dt (/ dt 10.0)))
(setvar "cmdEcho" 0)
(command "pline")
(while (<= theta 360.0)
(setq t1 (* (/ theta 180.0) pi))
(setq y1 (sin t1))
(command (list t1 y1))
(setq theta (+ theta dt))
); end of while()
(command "")
(princ)