;; | ---------------------------------------------------------------------------- ;; | GE_GetPoint@DistOnLine ;; | ---------------------------------------------------------------------------- ;; | Function : Returns a point on a line at a specified distance from the first ;; | point of the line. ;; | Argument : 'pt1' - First point of the line (can be a 3d point too) ;; | 'pt2' - Last point of the line (can be a 3d point too) ;; | 'd' - Distance of point along line ;; | Returns : an interpolated 3d point between 'pt1' and 'pt2' at a distance ;; | of 'd' from 'pt1' along 'pt2' ;; | Updated : July 25, 2002 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | ---------------------------------------------------------------------------- (defun GE_GetPoint@DistOnLine ( pt1 pt2 d / len Z Z1 Z2 dZ dH ang pt ) (setq Z1 (caddr pt1) Z2 (caddr pt2) len (distance pt1 pt2) ang (angle pt1 pt2) dZ (/ (* d (- Z2 Z1)) len) dH (sqrt (- (MI_Sqr d) (MI_Sqr dZ))) pt (polar pt1 ang dH) pt (list (car pt) (cadr pt) (+ Z1 dZ)) ) pt )