All pastes #741498 Raw Edit

Mine

public python v1 · immutable
·published 2007-10-18 19:14 UTC
rendered paste body
from numpy import *import randomdef attenFrii(r):	return ((lam/(4*pi))**2 * 1/(r**2))c = 3e8f=2.44e9lam=c/fN = 10000top=0bottom=0count=1while(count <= 1000000):    [Uab,Uac,Ubc] = [random.random()*40 for i in range(3)]    [xa,xb,xc,ya,yb,yc] = [random.random()*1000 for i in range(6)]        connAB=(attenFrii(sqrt((xa-xb)**2+(ya-yb)**2))>= 10**((-90+Uab)/10))    connAC=(attenFrii(sqrt((xa-xc)**2+(ya-yc)**2))>= 10**((-90+Uac)/10))    connBC=(attenFrii(sqrt((xb-xc)**2+(yb-yc)**2))>= 10**((-90+Ubc)/10))        if (connAB&connBC):        top += 1    if connAC:        bottom += 1        if count%100000==0 : print float(top)/float(bottom)    count += 1