cad的lisp问题
(setqpa(getpoint"请输入左下点"))(setqa(getreal"请输入a边="))(setqb(getreal"请输入b边="))(setqc(getr...
(setq pa (getpoint "请输入左下点"))
(setq a (getreal "请输入a边="))
(setq b (getreal "请输入b边="))
(setq c (getreal "请输入c边="))
(setq pb (polar pa 0 a))
(setq s (+(+a b) c)
(setq h (/ (* 2 s (-s a) (-s b) (-s c)) a))
(setq ang_pa (asin(/h c))
(setq pc (polar pa ang_pa c))
(command "pline" pa pb pc "c")
为什么老是输入有缺陷阿 救命啊
(prin1) 展开
(setq a (getreal "请输入a边="))
(setq b (getreal "请输入b边="))
(setq c (getreal "请输入c边="))
(setq pb (polar pa 0 a))
(setq s (+(+a b) c)
(setq h (/ (* 2 s (-s a) (-s b) (-s c)) a))
(setq ang_pa (asin(/h c))
(setq pc (polar pa ang_pa c))
(command "pline" pa pb pc "c")
为什么老是输入有缺陷阿 救命啊
(prin1) 展开
展开全部
你程序的问题蛮多的,几处少了括号,同时没有“asin”函数,“+a”,"-s","/h"等地方需要空格,(setq h (/ (* 2 s (-s a) (-s b) (-s c)) a))这句得到的h值似乎也不是很对。我改了一部分,至少能运行了,代码如下
(setq pa (getpoint "请输入左下点"))
(setq a (getreal "请输入a边="))
(setq b (getreal "请输入b边="))
(setq c (getreal "请输入c边="))
(setq pb (polar pa 0 a))
(setq s (+(+ a b) c))
(setq h (/(* 2 s (- s a) (- s b) (- s c)) a))
(setq ang_pa (atan(/ h c)))
(setq pc (polar pa ang_pa c))
(command "pline" pa pb pc "c")
ps:也真难得碰见问lisp的人,好久没用lisp了,都忘的查不多了。呵呵,剩下的自己再改改把。(暴金)
(setq pa (getpoint "请输入左下点"))
(setq a (getreal "请输入a边="))
(setq b (getreal "请输入b边="))
(setq c (getreal "请输入c边="))
(setq pb (polar pa 0 a))
(setq s (+(+ a b) c))
(setq h (/(* 2 s (- s a) (- s b) (- s c)) a))
(setq ang_pa (atan(/ h c)))
(setq pc (polar pa ang_pa c))
(command "pline" pa pb pc "c")
ps:也真难得碰见问lisp的人,好久没用lisp了,都忘的查不多了。呵呵,剩下的自己再改改把。(暴金)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询