rem P_3PL.CDL rem Copy Right by International Technology Transfer Corp. rem revision 1.0-7/30/99 rem Intersection of 3 Planes clear dspflg = 1 acc = 0.00001 :start getplane "Select First Plane ", dspflg on (@key + 3) goto exit, start, a1 = @fltdat[10] b1 = @fltdat[11] c1 = @fltdat[12] d1 = @fltdat[13] :second getplane "Select Second Plane", dspflg on (@key + 3) goto exit, start, second, a2 = @fltdat[10] b2 = @fltdat[11] c2 = @fltdat[12] d2 = @fltdat[13] :third getplane "Select Third Plane", dspflg on (@key + 3) goto exit, second, third, a3 = @fltdat[10] b3 = @fltdat[11] c3 = @fltdat[12] d3 = @fltdat[13] ab = a2 * b3 - a3 * b2 bc = b2 * c3 - b3 * c2 ca = a3 * c2 - a2 * c3 bunbo = a1 * bc + b1 * ca + c1 * ab if (abs(bunbo)>acc) goto next pause "At Least Two Planes are Parallel (Press Return)" redraw goto start :next da = d2 * a3 - d3 * a2 db = d2 * b3 - d3 * b2 dc = d2 * c3 - d3 * c2 x = (b1 * dc - c1 * db - d1 * bc) / bunbo y = (- a1 * dc + c1 * da -d1 * ca ) / bunbo z = (a1 * db - b1 * da - d1 * ab) / bunbo point x, y, z redraw goto start :exit