matlab计算两个多边形之间的最小距离

收录时间:2019-04-09
资源分类:Matlab 工具:MATLAB 7 (R14)

两个多边形之间的最小距离

 

Minimum distance between two polygons

This function computes the minimum euclidean distance between two

polygons P1 & P2.

 

min_d = min_dist_between_two_polygons(P1,P2,Display_solution);

 

This function takes two arguments, a third one is optional.

  P1 & P2 contain the geometry of polygons.

  P1 & P2 are structures containing two fields: x & y

  For example:

        P1.x = rand(1,5)+2;

        P1.y = rand(1,5);

        P2.x = rand(1,3);

        P2.y = rand(1,3);

  Display_solution is a binary variable that enables or not the

  plot of the solution.

 

The function starts by checking if polygons are intersecting.

In this case, the minimum distance is 0.

Otherwise, distances between all vertices and edges of the two

polygons are computed. The function returns the minimum distance found.

Further details of the implementation can be found in the code.

文件下载列表
附件内容(只显示4中的2个)
curveintersect.m  min_dist_between_two_polygons.m  
更多

目前尚无评论

用户反馈   关于我们
Copyright (©) ZHIHUISHI.COM 2013 All Rights Reserved.
京ICP备18060134号-3