I checked member functions of QLine, but there is no function/solution to this problem. I have two lines and if this two lines intersect than i want for return bool value - is it possible some easy way?!
I checked member functions of QLine, but there is no function/solution to this problem. I have two lines and if this two lines intersect than i want for return bool value - is it possible some easy way?!
You'll have to do proper math calculations using the y=ax+b formula.
Vincenzo (7th November 2008)
You could use QPainterPath::intersects(), but that's probably an overkill.
Hi, if you use 2D, two lines will intersect somewhere, if the "a" in wysota's formula is different for both lines, otherwise they are parallel. In 3D it's a different thing...
Ginsengelf
...I thought there is some function in Qt...
But I did it with math calculation like you told me, and now it works...
Bookmarks