;; | ---------------------------------------------------------------------------- ;; | GE_GetIncludedAngle ;; | ---------------------------------------------------------------------------- ;; | Function : Get the included angle between an origin point (O)and two other ;; | points, A and B joining it (origin point) and themselves. ;; | This gives the angle between OA and OB ;; | Arguments: 'po' - Origin point [ O ] ;; | 'pa' - First point [ A ] ;; | 'pb' - Second point [ B ] ;; | Returns : The included angle between the two vectors, OA and OB ;; | This is always less than 180 degrees. ;; | The included angle is always returned in degrees ;; | Update : June 14, 2000 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | ---------------------------------------------------------------------------- (defun GE_GetIncludedAngle ( po pa pb / _pa _pb x1 x2 ang1 ang2 ) (setq ang2 nil) (if (MI_3PUCS po pa nil) (progn (setq _pa (trans pa 0 1) _pb (trans pb 0 1) x1 (car _pa) x2 (car _pb) ) (command "._Ucs" "_Previous") (if (equal x2 0.0 0.001) (setq ang2 90.0) (progn (setq ang1 (GE_AngleBetn2L po pa po pb)) (cond ((>= x2 0.0) (setq ang2 (apply 'min ang1)) ) (T (setq ang2 (apply 'max ang1)) ) ) )) )) ang2 )