You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's try f(x) = 1 as the integrand. That gives "I = 2" as the analytic answer. Then the sum += 1 should be what we have. So sum = N. Then we divide by N and get I=1. OK yes something is wrong here. We need to divide by p(x) which is 1/2, so multiply by 2. I agree with the fix.
raytracing.github.io/books/RayTracingTheRestOfYourLife.html
Line 200 in 2460c2e
While the interval of integration is [0, 2], corresponding sample code is as below:
raytracing.github.io/books/RayTracingTheRestOfYourLife.html
Lines 226 to 233 in 2460c2e
Should
sum/N
be replaced to2*sum/N
?The text was updated successfully, but these errors were encountered: