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

4 vues (au cours des 30 derniers jours)
Cola
Cola le 11 Oct 2021
Commenté : Cola le 16 Oct 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.

Réponse acceptée

Image Analyst
Image Analyst le 11 Oct 2021
Someone just posted code from the Mathworks that does the local angle computation. See
  2 commentaires
Cola
Cola le 16 Oct 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 le 16 Oct 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)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Linear and Nonlinear Regression dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by