Borrar filtros
Borrar filtros

is there a function that receives 3 coordinates in X-Y as a matrix and calculates its Area and environment ?

1 visualización (últimos 30 días)
is there a function that receives 3 coordinates in X-Y as a matrix and calculates its Area and perimeter and coordinates of Center area?
Please Help

Respuesta aceptada

Matt J
Matt J el 21 de Nov. de 2021
Editada: Matt J el 21 de Nov. de 2021
p=polyshape(yourPoints);
area(p)
perimeter(p)
centroid(p)
  1 comentario
Shervin Akbari
Shervin Akbari el 21 de Nov. de 2021
function [ TriSPC ] = spcs(x)
% "C" won't give me coordinates
% How can i have coordinates of Center area?
x=input('Enter your Coordinates');
p=polyshape(x);
S=area(p);
P=perimeter(p);
C=centroid(p);
disp('area is:'), disp(S);
disp('Perimeter is:'), disp(P);
disp('Centriod is:'), disp(C);
end

Iniciar sesión para comentar.

Más respuestas (1)

Walter Roberson
Walter Roberson el 21 de Nov. de 2021
If you use the second output of boundary() then it will return the area.
The coordinates of the center of a set of 2D points, is the same as the mean() of each of the coordinates -- unless there is a non-uniform "weight" associated with the coordinates (for example if the core is denser then the edges.)
I do not know what "environment" means for the purpose of your question ?

Categorías

Más información sobre Computational Geometry en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by