Find the area of the astroid
7 次查看(过去 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 个)
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!