What is the quickest way to find the shortest cartesian distance between two polygons

后端 未结 13 1585
迷失自我
迷失自我 2021-02-01 05:54

I have 1 red polygon say and 50 randomly placed blue polygons - they are situated in geographical 2D space. What is the quick

13条回答
  •  遇见更好的自我
    2021-02-01 06:34

    I know you said "the shortest distance" but you really meant the optimal solution or a "good/very good" solution is fine for your problem?

    Because if you need to find the optimal solution, you have to calculate the distance between all of your source and destination poligon bounds (not only vertexes). If you are in 3D space then each bound is a plane. That can be a big problem (O(n^2)) depending on how many vertexes you have.

    So if you have vertex count that makes that squares to a scarry number AND a "good/very good" solution is fine for you, go for a heuristic solution or approximation.

提交回复
热议问题