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

1 次查看(过去 30 天)
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.

采纳的回答

Matt J
Matt J 2018-7-10
编辑:Matt J 2018-7-10
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 );

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Computational Geometry 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by