- (defun c:tt()
- (setq pt1 (getpoint "\n请指定三角形在屏幕中的位置:"))
- (setq a (getreal "\n请输入三角形第一条边长:"))
- (setq b (getreal "\n请输入三角形第二条边长:"))
- (setq c (getreal "\n请输入三角形第三条边长:"))
- (setq qq (/ (+ a b c) 2))
- (setq s (sqrt (* qq (- qq a) (- qq b) (- qq c))))
- (setq h (/ (* s 2) c))
- (setq d (sqrt (- (* b b) (* h h))))
- (setq jj (atan (/ h d)))
- (setq pt2 (polar pt1 0 c))
- (setq pt3 (polar pt1 jj b))
- (command "pline" pt1 pt2 pt3 "c" "")
- )
|