How to calculate the area of the curve around a point?

4 visualizaciones (últimos 30 días)
Cola
Cola el 11 de Oct. de 2021
Comentada: Cola el 16 de Oct. de 2021
There is a curve, and the coordinates of each point of the curve is known. Is there a way to calculate the area of the curve around a point? Thanks!
For example, I plot a curve by Data.mat as shown below, and (0,20) is a point of attraction.
Now I want to calculate the area as shown below by Data.mat.
The whole area can be divided to these parts.

Respuesta aceptada

Image Analyst
Image Analyst el 11 de Oct. de 2021
Someone just posted code from the Mathworks that does the local angle computation. See
  2 comentarios
Cola
Cola el 16 de Oct. de 2021
@Image Analyst Thank you very much. And there is a code for reference.
Code:
delta_x=Data(:, 1)-0;
delta_y=Data(:, 2)-20;
L=sqrt(delta_x.^2+delta_y.^2)
a=L(1:2000,1);
b=L(2:2001,1);
for i=1:1:2000
c(i,:)=sqrt((Data(i, 1)-Data(i+1, 1)).^2+(Data(i, 2)-Data(i+1, 2)).^2)
end
p=(a+b+c)./2; %% Heron's formula
S=sqrt((p-a).*(p-b).*(p-c).*p)
Total_S=sum(S)
Cola
Cola el 16 de Oct. de 2021
Eliminating iteration by code:
c1=Data(1:2000,:);
c2=Data(2:2001,:);
c=sqrt((c1(:, 1)-c2(:, 1)).^2+(c1(:, 2)-c2(:, 2)).^2)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Linear and Nonlinear Regression en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by