[英]how can I find a shortest line (2 end points will be fine) from a group of points which is intersect with another given line segment
Say I got a bunch of points(red points) and a blue line segment , i want to find a line(2 points) which is intersect with the blue line segment and the sum of two end points' perpendicular distance to the blue line segment is the shortest distance.假设我有一堆点(红点)和一条蓝线段,我想找到一条与蓝线段相交的线(2 点)以及两个端点与蓝线段的垂直距离之和是最短距离。
P in this picture above is CD and the blue line segment intersect point.上图中的 P 是 CD 和蓝色线段的交点。
I only know that they should be on the blue line's different side (left/right or above/below).我只知道它们应该在蓝线的另一侧(左/右或上/下)。
But there are still serveral variants can make this go south.Like AB and CE in this picture.但是仍然有几个变体可以使这个 go 南下。像这张照片中的 AB 和 CE。
Edit: At first i thought i only need to make sure both of two end points' projection point lies on the blue line segment .But if I do so,there might be not so many good points for this case.I might just throw the only solution away.编辑:起初我以为我只需要确保两个端点的投影点都位于蓝线段上。但如果我这样做,这种情况下可能没有那么多优点。我可能只是抛出唯一的解决办法。
Sketch of algorithm:算法示意图:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.