Borrar filtros
Borrar filtros

Calculating distance from central point to perimeter of shape engulfing central point.

5 visualizaciones (últimos 30 días)
Hi all, I'm trying to make a code which takes a non-moving graph point and calculates the distance from that point to the nearest perimeter point of a shape surrounding it. The shape may vary in sides and location relative to that central point, but the central point will always be located inside of the shape. English is not my first language, so pardon me if this is unprofessionally written. I will attempt to clarify further if it is needed. Thanks, all.

Respuesta aceptada

Matt J
Matt J el 10 de Jul. de 2018
Editada: Matt J el 10 de Jul. de 2018
How is the shape represented? As an image? If so, bwdist() will give you the result directly. You could also do
[i,j]=find(yourImage);
mindist=min( (i-i0).^2 + (j-j0).^2 );

Más respuestas (0)

Categorías

Más información sobre Statistics and Machine Learning Toolbox 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