필터 지우기
필터 지우기

Surface area of sphere integral form

조회 수: 2 (최근 30일)
Riley Copeland
Riley Copeland 2019년 11월 8일
편집: Shubham Gupta 2019년 11월 8일
I want to write a section of code that calculates the surface area of a sphere by solving the integral form. The ultimate goal is to change the limits of integration to find sections of the area. Problem is that the value of 'S' I'm getting is way off. Thanks for the help!
R = 1; % radius of sphere (m)
theta_1 = 0;
theta_2 = pi;
fun = @(theta) -cos(theta);
S = 4*pi*R^2*(integral(fun,theta_1,theta_2));

답변 (1개)

Shubham Gupta
Shubham Gupta 2019년 11월 8일
편집: Shubham Gupta 2019년 11월 8일
Limits should be [0, pi/2] & fun should be sin
fun = @(theta) sin(theta);
S = 4*pi*R^2*(integral(fun,theta_1,theta_2/2)); % this will give correct answer

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by