rem AREA_3PT.CDL rem Copy Right by International Technology Transfer Corp. rem revision 1.0 7/30/99 rem Area of Triangle rem 1. Select 3 points rem 2. Calculate Area clear defopt = 2 acc = 0.00001 :start getpos "Indicate First Point",defopt on (@key + 3) goto exit, start, defopt=@key wx1 = @xworld wy1 = @yworld wz1 = @zworld :second getpos "Indicate Second Point",defopt on (@key + 3) goto exit, start, second, defopt=@key wx2 = @xworld wy2 = @yworld wz2 = @zworld :third getpos "Indicate Third Point",defopt on (@key + 3) goto exit, second, third, defopt=@key wx3 = @xworld wy3 = @yworld wz3 = @zworld a = (wy2 - wy1) * (wz3 - wz1) - (wz2 - wz1) * (wy3 - wy1) b = (wz2 - wz1) * (wx3 - wx1) - (wx2 - wx1) * (wz3 - wz1) c = (wx2 - wx1) * (wy3 - wy1) - (wy2 - wy1) * (wx3 - wx1) s = sqrt(a * a + b * b + c * c) / 2 pause "Area of Triangle = %.3fiPress Returnj", s redraw goto start :exit