简体   繁体   中英

How do i find the smallest point P(x,y) containing triangle from a bunch of points?

This is something a human child can do, but I need a computer to do it :D

Guess you have a point P(x,y) and you have an array of points A = [P1, P2, P3, …]

What i basically need to get is the 3 points that

  • form a triangle that surrounds P
  • form from those that surround P the smallest triangle possible

Well, of course I could just bruteforce it by calculating all possible triangles, barycentric interpolate if they're containing the point and compare the areas size of the resulting triangles, but this soon gets very time consuming.

I think this has been done before and is one of those ›if-you-know-the-name-of-the-algorythm-you-know-what-to-implement‹-problems.

I should add that if two triangles are reasonably close in size, than any of them would be a good solution, so in that case, the faster solution would be the better one.

Build Delaunay triangulation for given set of points and find triangle containing the point.

Perhaps it will not the most optimal triangle, but algorithm is well-known and fast.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM