Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
作为输入,我收到了一些平面的三角几何。现在,我需要计算边界矩形角的四个坐标。有任何想法吗?
我将假设您在问题标题中指的是 2D 空间,因为其他所有内容均指 2D。
遍历几何中的所有顶点 (x,y),并计算 x 的最大值和最小值,以及 y 的最大值和最小值。
然后边界矩形的顶点将是 (min_x,min_y)、(max_x,min_y)、(max_x, max_y) 和 (min_x, max_y)。