what is the best way to calculate the upper area between the closed curve and the line?
alpha = [0:pi/360:2*pi];
x = 2.*(1-cos(alpha)).*cos(alpha);
y = 2.*(1-cos(alpha)).*sin(alpha);
w = [-4:0.1:0.5];
z = 0.5*w;
plot(x,y);
hold on;
grid on;
plot(w,z);
Is it possible to solve it by using trapz, even if it is a closed curve and occupying both positive and negative y axis? I saw a lot of topics about just a closed curve or a curve and a line. But none about a clsed curve and a line.
Thanks.