# to operate this progam, copy it to your own directory (as "box.sm"), # start sm, # (start a plot window if there is't one already with device x11). # while in sm, type: input box.sm # define N 10000 # "random" gives random numbers uniformly distributed between 0 and 1. # x & y below each are randomly distributed between -1 and +1. set x=2*random($N)-1 set y=2*random($N)-1 set t= x*x+y*y < 1 ? 1 : 0 limits -1 1 -1 1 box 3 3 3 3 ctype red ltype 2 circle 0 0 1 ctype 0 ltype 0 expand .5 ptype 20 3 points x y ctype red points x y if(x*x+y*y<1) ctype 0