初学者,想知道下面的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/06/28 08:49:45
![初学者,想知道下面的AutoLisp程序错在哪里(圆的渐开线)?怎么改(defun c:jkxg(/ p0 jr rmax r dr phi x0 y0 x1 y1 x2 y2)(graphscr)(setq p0(getpoint](/uploads/image/z/14812478-62-8.jpg?t=%E5%88%9D%E5%AD%A6%E8%80%85%2C%E6%83%B3%E7%9F%A5%E9%81%93%E4%B8%8B%E9%9D%A2%E7%9A%84AutoLisp%E7%A8%8B%E5%BA%8F%E9%94%99%E5%9C%A8%E5%93%AA%E9%87%8C%EF%BC%88%E5%9C%86%E7%9A%84%E6%B8%90%E5%BC%80%E7%BA%BF%EF%BC%89%3F%E6%80%8E%E4%B9%88%E6%94%B9%28defun+c%3Ajkxg%28%2F+p0+jr+rmax+r+dr+phi+x0+y0+x1+y1+x2+y2%29%28graphscr%29%28setq+p0%28getpoint%22%5Cn%E8%BE%93%E5%85%A5%E5%9F%BA%E5%9C%86%E7%9A%84%E5%9C%86%E5%BF%83%EF%BC%9A%22%29%29%28setq+jr%28getdist+p0%22%5Cn%E8%BE%93%E5%85%A5%E5%9F%BA%E5%9C%86%E7%9A%84%E5%8D%8A%E5%BE%84%EF%BC%9A%22%29%29%28setq)
初学者,想知道下面的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 .改好了,加载是没问题,不过我随便输入数据画不出图形来,不知道是不是数据问题.