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

4 Ansichten (letzte 30 Tage)
Cola
Cola am 11 Okt. 2021
Kommentiert: Cola am 16 Okt. 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.

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Linear and Nonlinear Regression finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by