Find the area of the astroid
조회 수: 6 (최근 30일)
이전 댓글 표시
채택된 답변
KSSV
2016년 11월 17일
편집: KSSV
2016년 11월 17일
a = 4 ;
% parametric equations of Asteroid
N = 1000; % keep more for accurate answer
t = linspace(0,2*pi,N) ;
x = a*cos(t).^3 ;
y = a*sin(t).^3 ;
plot(x,y)
% Get area using the curve points
A = polyarea(x,y) ;
% get area using the formula
Af = 3 * pi * a^2 / 8;
[A Af]
댓글 수: 0
추가 답변 (3개)
Walter Roberson
2016년 11월 16일
solve() for y in terms of x and a. Integrate from x = 0 to x = a
댓글 수: 0
Image Analyst
2016년 11월 16일
댓글 수: 2
Image Analyst
2016년 11월 16일
That IS code. You just need to define a.
a=10; % Whatever you want.
astroidArea = 3 * pi * a^2 / 8;
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!