;; CVRAD -- curve radius for splines
;; (C.) 1999 by Vladimir Nesterovsky,
;; http://vnestr.tripod.com, vnestr@netvision.net.il
;; r = ( (x')^2 + (y')^2 )^3/2 / ( x''y' - y''x' )
;; it's the right thing!!!!! ACAD only errors for plines,
;; where it always returns radius positive
(defun cvrad
(o a
/ f s r fx fy sx sy k d
) fy
(cadr f
) ; x'' and y'' k
(expt (+ (* fx fx
) (* fy fy
)) 1.5) ; it's (- (book-formula)) somehow d (- (- (* sx fy) (* sy fx)))
)
((< (abs (setq r
(/ k d
))) 1e
+7
) r
) ((< r 0) -1e+7)
(1e+7)
)
)