Hi guys,
I'm trying to numerically calculate the integral after Equation (1) from here: Distances In Bounded Regions
The final purpose is to calculate the average distance between all points in a region.
The result of the integral should be 0.5214.
I'm calculating it by calling integral2 function like this:
clear all;f = @(theta,r)(1-r.*sin(theta)).*(1-r.*cos(theta)).*r.^2;ymax = @(theta)1./cos(theta);xmax = pi/8;8*integral2(f, 0, xmax, 0, ymax)
However I'm getting the wrong answer. What's the problem with my code?
Best Answer