相关疑难解决方法(0)

如何检测两个线段相交的位置?

如何确定两条线是否相交,如果它们相交,在x,y点处是什么?

geometry line-intersection

519
推荐指数
17
解决办法
41万
查看次数

确定一条线所在的一侧

我有一条直线(x1,y1)和(x2,y2).我想看看点(x3,y3)是否位于所述线的"左"或"右".我该怎么办?

math geometry point line

56
推荐指数
0
解决办法
4万
查看次数

确定两个线段是否相交?

可能重复:
如何检测两个线段相交的位置?

有人可以提供算法或C代码来确定两个线段是否相交?

algorithm math geometry

12
推荐指数
2
解决办法
5万
查看次数

测试多边形是否非常简单

我无法想出一种算法来检测弱的简单多边形(即允许边接触但不能交叉的多边形).目前我只是检查每一方之间的交叉点 - 这是我呼吁所有非相邻方的功能.这样,只允许简单的多边形(根本不接触).多边形是点的向量.

bool linesIntersect(const point &a1, const point &a2, const point &b1, const point &b2) {
    // Solve intersection of parametric lines using inverse matrix
    // The equation of the parametric lines are line1 = (a2 - a1)*s + a1
    // and line2 = (b2 - b1)*t + b1, where a1, a2, etc. are vectors.
    // Two equations can be produced from the two components, and these
    // this system of two equations can be solved for s and …
Run Code Online (Sandbox Code Playgroud)

c++ algorithm geometry polygons

5
推荐指数
1
解决办法
602
查看次数

标签 统计

geometry ×4

algorithm ×2

math ×2

c++ ×1

line ×1

line-intersection ×1

point ×1

polygons ×1