intersection point of two lines

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2013-02-03 08:49 PM
2013-02-03
08:49 PM
line2 x11, y11, x12, x12
line2 x21, y21, x22, y22
is there a simple solution for this?
I am not so settlet in vector mathematics.. and tried it over the angles but my brain now is boiling...

I hope someone can help - thanks forwarding..
AC5.5-AC27EduAut, PC-Win10, MacbookAirM1, MacbookM1Max, Win-I7+Nvidia
14 REPLIES 14
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-03-14 05:27 PM
2019-03-14
05:27 PM
Hello,
So this almost does what I want it to. However I want to be able to say if the lines DO intersect completely (I don't just mean parallel like this) then to do something. I can't work out how I can achieve it.
Basically I'd like to know if line2 x[1], y[1], x[2], y[2] and line2 x[3], y[3], x[4], y[4] cross over and if they do then show an error.
I don't know if this is achievable or not as I haven't found any solution to it online and this is as close to what I need to achieve as I've been able to find.
Thanks!
So this almost does what I want it to. However I want to be able to say if the lines DO intersect completely (I don't just mean parallel like this) then to do something. I can't work out how I can achieve it.
Basically I'd like to know if line2 x[1], y[1], x[2], y[2] and line2 x[3], y[3], x[4], y[4] cross over and if they do then show an error.
I don't know if this is achievable or not as I haven't found any solution to it online and this is as close to what I need to achieve as I've been able to find.
Thanks!
ArchiCAD 23
Windows 10
Windows 10

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-03-14 07:15 PM
2019-03-14
07:15 PM
I havent tried this, but maybe it could help, I am not shure:
http://gdl.graphisoft.com/tips-and-tricks/calling-basicgeometriccalc-macro
Jochen Suehlo . AC12-28 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de
GDL object creation: b-prisma.de

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-03-15 02:29 AM
2019-03-15
02:29 AM
If it is just if they intersect or not, regardless of where they actually intersect, can you just compare the slope ratio between your two lines? If they are equal, then they are parallel.
By the looks if it, that is a pretty convenient macro. It will give you the intersection coordinates too.
Ling.
If ( x[1] + x[2] ) / ( y[1] + y[2] ) = ( x[3] + x[4] ) / ( y[3] + y[4] ) then else ...
I havent tried this, but maybe it could help, I am not shure:
http://gdl.graphisoft.com/tips-and-tricks/calling-basicgeometriccalc-macro
By the looks if it, that is a pretty convenient macro. It will give you the intersection coordinates too.
Ling.
AC22-28 AUS 3110 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win11 | R5 2600 | 16GB | GTX1660 |
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-03-15 10:34 AM
2019-03-15
10:34 AM
It's if the lines actually cross over and not if they cross over at some point if they were longer lines...
ArchiCAD 23
Windows 10
Windows 10

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-03-18 02:50 AM
2019-03-18
02:50 AM
Well, using the same macro, you could just compare the vector intersection coordinates to your point to point? Can you use ranges? a < b < c
Basically, if the intersection falls within the quadrangle formed by your line end points, then their line segments intersect.
Ling.
call "BasicGeometricCalc" parameters iFunction = INTERSECT_LINE_LINE, vx1 = vx1, vy1 = vy1, px1 = px1, py1 = py1, vx2 = vx2, vy2 = vy2, px2 = px2, py2 = py2, returned_parameters ipx, ipy, state If State = 1 then If vx1 < ipx < vx2 & vy1 < ipy < vy2 & px1 < ipx < px2 & py1 < ipy < pvy2 then ... endIf endIf
Basically, if the intersection falls within the quadrangle formed by your line end points, then their line segments intersect.
Ling.
AC22-28 AUS 3110 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win11 | R5 2600 | 16GB | GTX1660 |
- « Previous
-
- 1
- 2
- Next »
- « Previous
-
- 1
- 2
- Next »