初学者,想知道下面的AutoLisp程序错在哪里(圆的渐开线)?怎么改(defun c:jkxg(/ p0 jr rmax r dr phi x0 y0 x1 y1 x2 y2)(graphscr)(setq p0(getpoint"\n输入基圆的圆心:"))(setq jr(getdist p0"\n输入基圆的半径:"))(setq
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/28 00:52:04
初学者,想知道下面的AutoLisp程序错在哪里(圆的渐开线)?怎么改(defun c:jkxg(/ p0 jr rmax r dr phi x0 y0 x1 y1 x2 y2)(graphscr)(setq p0(getpoint"\n输入基圆的圆心:"))(setq jr(getdist p0"\n输入基圆的半径:"))(setq
初学者,想知道下面的AutoLisp程序错在哪里(圆的渐开线)?怎么改
(defun c:jkxg(/ p0 jr rmax r dr phi x0 y0 x1 y1 x2 y2)
(graphscr)
(setq p0(getpoint"\n输入基圆的圆心:"))
(setq jr(getdist p0"\n输入基圆的半径:"))
(setq rmax(getdist "\n 输入渐开线的终止极径:"))
(command "circle"p0 r)
(setq dr(getdist "\n 输入极径增量:"))
(setq x0(car p0)y0(cadr p0))
(setq r jr)
(setq phi(sprt (- 1 (/ (* r r) (* jr jr))))
(setq x1(+ x0(* r(cos phi)))
(setq y1(+ y0(* r(sin phi)))
(while (< r rmax)
(setq r(+ r dr))
(setq x2(+ x0(* r(cos phi)))
(setq y2(+ y0(* r(sin phi)))
(command "line" ls (list x1 y1)(list x2 y2)"")
(setq ls (list x y))
(setq x1 x2 y1 y2)
编译的时候系统报列表错误.
初学者,想知道下面的AutoLisp程序错在哪里(圆的渐开线)?怎么改(defun c:jkxg(/ p0 jr rmax r dr phi x0 y0 x1 y1 x2 y2)(graphscr)(setq p0(getpoint"\n输入基圆的圆心:"))(setq jr(getdist p0"\n输入基圆的半径:"))(setq
(defun c:jkxg(/ p0 jr rmax r dr phi x0 y0 x1 y1 x2 y2)
(graphscr)
(setq p0(getpoint"\n输入基圆的圆心:"))
(setq jr(getdist p0"\n输入基圆的半径:"))
(setq rmax(getdist "\n 输入渐开线的终止极径:"))
(command "circle"p0 jr)
(setq dr(getdist "\n 输入极径增量:"))
(setq x0(car p0)y0(cadr p0))
(setq r jr)
(setq phi(sqrt (- 1 (/ (* r r) (* jr jr)))))
(setq x1(+ x0(* r(cos phi))))
(setq y1(+ y0(* r(sin phi))))
(while (< r rmax)
(setq r(+ r dr))
(setq x2(+ x0(* r(cos phi))))
(setq y2(+ y0(* r(sin phi))))
(command "line" ls (list x1 y1)(list x2 y2)"")
(setq ls (list x y))
(setq x1 x2 y1 y2)
)
)
;;少了好几个)肯定会提示出错的. 还有就是 sqrt 函数不是 sprt .改好了,加载是没问题,不过我随便输入数据画不出图形来,不知道是不是数据问题.