Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
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.

Akzeptierte Antwort

Matt J
Matt J am 10 Jul. 2018
Bearbeitet: Matt J am 10 Jul. 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 );

Weitere Antworten (0)

Kategorien

Mehr zu Computational Geometry 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