简体   繁体   English

给定一组点生成矩形坐标的算法

[英]Algorithm to generate rectangle coordinates given a set of points

I have a set of points on 2D plane, each has its screen coordinates X and Y. They are placed this way: 我在2D平面上有一组点,每个点都有其屏幕坐标X和Y。它们的放置方式是:

在此处输入图片说明

You see they are placed in horizontal lines, but X coordinate is quite random. 您会看到它们被放置在水平线上,但是X坐标是相当随机的。 A number of points in each line is not necessarily the same. 每行中的点数不一定相同。

Given these coordinates, I need to generate triangles so that each edge of the triangle connects a pair of points which are close to each other, if possible: 给定这些坐标,我需要生成三角形,以便三角形的每个边缘连接一对彼此靠近的点,如果可能的话:

在此处输入图片说明

Is there any known algorithm or library for this? 是否有任何已知的算法或库?

You need point set triangulation . 您需要点集三角剖分

In described case Delaunay triangulation should give desired result. 在所描述的情况下, Delaunay三角剖分应给出期望的结果。

Library by JRShewchuk (and it's not hard to find triangulation implementation for any popular language) JRShewchuk编写的库 (不难发现任何流行语言的三角剖分实现)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 给定两个对角点,如何生成形成一个矩形的所有坐标? - Given two diagonal points, how to generate all coordinates forming a rectangle? 查找给定网格点的相应矩形坐标 - Finding corresponding rectangle coordinates given grid points 在给定一组XY坐标的情况下,插入缺失数据点的好算法是什么? - What is a good algorithm for interpolating missing points of data given a set of X-Y coordinates? 生成满足给定约束条件的N维空间中所有点的算法 - Algorithm to generate all points in an N-dimensional space satisfying a given set of constraints 算法从坐标确定矩形 - algorithm to determine a rectangle from coordinates Android:在给定点的情况下设置Google地图缩放和位置的算法 - Android: Algorithm to set zoom and location of Google map given a sets a points 找到最接近给定 3D 线集的点的算法 - Algorithm to find the points closest to a given set of 3D lines 在给定一组点的情况下,是否有一个众所周知的算法填充网格? - Is there a well known algorithm fill in the grid given a set of points? 是否有任何算法可以在O(n ^ 2)时间内生成给定集合的所有子集? - Is there any algorithm to generate all subsets of a given set in O(n^2) time? 快速算法查找矩形内的所有点 - Fast algorithm to find all points inside a rectangle
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM