From the wizard known as _gile:
Code:
;;; ArcChord->Angle (Newton method) by _gile
;;; Returns the arc angle according to its chord and length
(defun ArcChord->Angle (arc corde / k x)
(setq k (/ corde arc)
x (sqrt (- 6 (* 6 k)))
)
(repeat 6
(setq x (- x (/ (- (sin x) (* k x)) (- (cos x) k))))
)
(* 2 x)
)
;;;======================================;;;
;;;Testing command
(defun c:test (/ chord arc ang rad)
(while
(not
(and (setq chord (getdist "\nLength of chord: "))
(setq arc (getdist "\nLength of arc: "))
(< chord arc)
)
)
(prompt "Try again -- arc must be longer than chord.")
)
(setq ang (ArcChord->Angle arc chord)
rad (/ chord (* 2. (sin (/ ang 2.)))) )
(prompt
(strcat "\nChord length = " (rtos chord)
"\nArc length = " (rtos arc)
"\nRadius = " (rtos rad)
"\nAngle = " (angtos ang) )
)
(princ)
)