;; | ---------------------------------------------------------------------------- ;; | GE_GetBoxAroundPt ;; | ---------------------------------------------------------------------------- ;; | Function : Returns the coordinates of a box (window) around a point ;; | The window may be a square or rectangle ;; | Arguments: 'pt' - Center point of the window ;; | 'dX' - X Dimension of the box ;; | 'dY' - Y Dimension of the box ;; | 'Rot' - Rotation angle of the box (measured in default AutoCAD ;; | terms - 0 is east and ccw direction is positive) ;; | Action : Returns a list of 4 points starting from the top left and in ;; | clockwise direction. ;; | Updated : April 28, 2000 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | ---------------------------------------------------------------------------- (defun GE_GetBoxAroundPt( pt dX dY Rot / p1 p2 p3 p4 halfX halfY _Rot ) (setq halfX (* 0.5 dX) halfY (* 0.5 dY) _Rot (MI_d2r Rot) p1 (polar pt (+ _Rot pi) halfX) p1 (polar p1 (+ _Rot #pb2) halfY) p2 (polar p1 _Rot dX) p3 (polar p2 (- _Rot #pb2) dY) p4 (polar p3 (+ _Rot pi) dX) ) (list p1 p2 p3 p4) )