MATLAB Answers

1

areaint has a singularity?

Asked by Maarten Buijsman on 18 Jul 2019
Latest activity Answered by Harsha Priya Daggubati on 12 Aug 2019
In MATLAB17a I am computing surface integrals for rectangular polygons on a sphere ("earth") using areaint and wgs84Ellipsoid.
I get annomalously large surface areas in meter-squared when my rectangular polygons cover latitude 0 and longitude 0, 180, or 360 degrees. Away from these points the surface area is what you would expect. Is this a singularity (an error), or am I doing something wrong?
% example code
dy = 2.5;
E = wgs84Ellipsoid;
% declare longitudes and latitudes
%lonc = -5:1:5;
lonc = 175:1:185;
latc = -5:1:5;
AA = ones(length(latc),length(lonc)); %declare area
for i=1:length(lonc)
disp(num2str(i))
for j=1:length(latc)
% make rectangular polygons centered on lonc and latc
lonp = [lonc(i)-dy/2 lonc(i)+dy/2 lonc(i)+dy/2 lonc(i)-dy/2 lonc(i)-dy/2];
latp = [latc(j)-dy/2 latc(j)-dy/2 latc(j)+dy/2 latc(j)+dy/2 latc(j)-dy/2];
AA(j,i) = areaint(latp,lonp,E);
end
end
% plot surface area
figure
pcolor(lonc,latc,AA);
colorbar

  0 Comments

Sign in to comment.

Products


Release

R2017a

1 Answer

Answer by Harsha Priya Daggubati on 12 Aug 2019

Hi,
I suspect this discrepancy is due to the dy value you chose.

  0 Comments

Sign in to comment.