我做了一个惭开线程序,运行时出现:symbolp nil .我是个初学者,请各位大虾指点一个:
(defun c:involute(/ p0 phi phimas phimin) (setq p0 (getpoint "\n输入基圆的圆心: ")) (setq r (getdist p0 "请输入基圆的半径: ")) (command "circle" p0 r); (setq phimin (getreal "\n输入渐开线的起始角(弧度):")) (setq phimax (getreal "\n输入渐开线的终止角(弧度):")) (setq dphi (getreal "\n输入角度增量(弧度):")) (setq n (/ (- phimax phimin) dphi)); (setq dphi (/ (- phimax phimin) n)); (setq x0 (car p0) yo (cadr p0)); (setq phi phimin) (setq x1 (+ x0 (* r (+ (cos phi) (* phi (sin phi)))))) (setq y1 (+ x0 (* r (- (sin phi) (* phi (cos phi)))))) (while (<= phimax) (setq phi (+ phi dphi)) (setq x2 (+ x0 (* r (+ (cos phi) (* phi (sin phi)))))) (setq y2 (+ x0 (* r (- (sin phi) (* phi (cos phi)))))) (set p1 (list x1 y1)) (set p2 (list x2 y2)) (command "pline" p1 p2""); (setq x1 x2 y1 y2))) |