(defun C:arrowhead (/ an dd enda p1 p2 p3 p4 w)
  (setvar "cmdecho" 0)
  (initget "A B C")
  (setq	enda (getkword
	       "\n绘制箭头[直箭头(A)/弯箭头(B)/大弯箭头(C)]<直箭头>:"
	     )
  )
  (or enda (setq enda "A"))
  (while (and (setq p1 (getpoint "\n箭头的尖端位置:"))
	      (setq p2 (getpoint p1 "\n箭头的另一端:"))
	 )
    (setq dd (distance p1 p2))
    (princ (rtos dd 2 4))
    (setq w  (* dd 1.2)
	  an (angle p1 p2)
	  p3 (polar p2 (+ an (* pi 0.5)) (/ w 2.0))
	  p4 (polar p2 (+ an (* pi 1.5)) (/ w 2.0))
    )
    (cond ((= enda "A")
	   (command "pline"
		    p1
		    "w"
		    "0"
		    w
		    p2
		    "w"
		    (* w 0.4)
		    (* w 0.4)
		    (polar p2 an (getdist p2))
		    ""
	   )
	  )
	  ((= enda "B")
	   (command "pline"
		    p1
		    "w"
		    "0"
		    w
		    p2
		    "w"
		    (* w 0.4)
		    (* w 0.4)
		    "a"
		    pause
		    ""
	   )
	  )
	  ((= enda "C")
	   (command "pline"
		    p1
		    "w"
		    "0"
		    w
		    p2
		    "w"
		    (* w 0.4)
		    w
		    "a"
		    pause
		    ""
	   )
	  )
    )
  )
  (princ)
)