rem P_LNC.CDL rem Copy Right by International Technology Transfer Corp. rem revision 1.0-7/30/99 rem Intersection between Line and Circle clear array mtx[9] acc = 0.00001 :start getent "Select Circle",enttype on (@key + 3) goto exit, start, start, if (enttype!=3) goto start vnum = @intdat[8] vx0 = @fltdat[0] vy0 = @fltdat[1] vz0 = @fltdat[2] r = @fltdat[3] getview vnum, mtx :line getent "Select Line",enttype on (@key + 3) goto exit, start, line, if (enttype!=2) goto line wx1 = @fltdat[0] wy1 = @fltdat[1] wz1 = @fltdat[2] wx2 = @fltdat[3] wy2 = @fltdat[4] wz2 = @fltdat[5] call xfmwv, mtx, wx1, wy1, wz1, vx1, vy1, vz1 call xfmwv, mtx, wx2, wy2, wz2, vx2, vy2, vz2 if (abs(vz0-vz1)acc) goto next3 t = fxgy / fgsq x = vx1 + f * t y = vy1 + g * t view vnum, mtx[0], mtx[1], mtx[2], mtx[3], mtx[4], mtx[5], mtx[6], mtx[7], mtx[8] vpoint x, y, vz1, vnum, @color redraw goto start :next3 ref1 = sqrt(ref1) t1 = (fxgy - ref1) / fgsq t2 = (fxgy + ref1) / fgsq x1 = vx1 + f * t1 y1 = vy1 + g * t1 x2 = vx1 + f * t2 y2 = vy1 + g * t2 view vnum, mtx[0], mtx[1], mtx[2], mtx[3], mtx[4], mtx[5], mtx[6], mtx[7], mtx[8] vpoint x1, y1, vz1, vnum vpoint x2, y2, vz1, vnum redraw goto start :exit clear