// sorta works: =((1*3.14159265358979*1)/3*1) def test_MonteCarlo_double_circle_r(): def g(x,y): xc, y = 0, 0 # center R = 2 # radius return r**2 – ((x-xc)**2 + (y-yc)**2) import sympy r = sympy.symbols('r') I_exact = sympy.integrate(2*sympy.pi*r*r, (r,0,2)) print 'Exact integral:', I_exact.evalIf()
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question