Advertisement
Guest User

Solid Area

a guest
Jan 27th, 2012
487
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import math
  2.  
  3. w = 0.0
  4.  
  5. rez = 1024
  6. for v in range(0, rez):
  7.     for u in range(0, rez):
  8.         s = (2.0 * u)/rez - 1.0
  9.         t = (2.0 * v)/rez - 1.0
  10.         tmp = 1.0+s*s+t*t
  11.         w += 4.0/(tmp * math.sqrt(tmp))
  12.  
  13. print (4*math.pi/6), w/(rez*rez), (4*math.pi/6)-w/(rez*rez)
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement