本帖最后由 作者 于 2010-8-26 16:12:32 编辑
错误: 参数类型错误: numberp: nil,我不知道哪个参数类型错误,不知哪位大侠可以指点一下?
(defun c:5test3(/ pa pb pc a b c h w ang_pb s area) ;设置系统变量 (setvar "cmdecho" 0) (setvar "blipmode" 0) ;设置输入值 (setq pa (getpoint "\n输入三角形一个顶点:")) (setq a (getdist pa "\n输入三角形一边长度:")) (setq b (getdist pa "\n输入三角形另一边长度:")) (setq a (getdist pa "\n输入三角形第三边长度:")) ;计算 (setq s (* 0.5 (+ a b c))) (setq area (sqrt (* s (s-a) (s-b) (s-c)))) (setq h (/ (* 2 area) a)) (setq w (sqrt (- (* b b) (* h h)))) (setq ang_pb (atan h w)) (setq ang_pb (- pi ang_pb)) (setq pb (polar pa 0 a)) (setq pc (polar pb ang_pb b)) (setq pd (polar pb pi w)) ;绘制 (command "pline" pa pb pc "c") (command "line" pc pd "") (prin1)) |