在LISP中:
- ;; BulgeData ~ Lee Mac
- ;; Args: p1,p2 Points, b Bulge
- ;; Returns: (<centre> <inc. angle> <radius>)
- (defun BulgeData (p1 p2 b / theta/2 radius centre)
- (setq theta/2 (* 2. (atan b))
- radius (/ (distance p1 p2) (* 2. (sin theta/2)))
- centre (polar p1 (+ (- (/ pi 2.) theta/2) (angle p1 p2)) radius))
- (list centre (* 2. theta/2) (abs radius)))
|