Maxunderground news unavailable

Trigonometry script help 
3joez 
I would like to infere the coordinates of the intersecting point of the two lines. I can calculate the angle via dotproduct but I'm stuck on how to get the pivot point of that angle. Here's the pic
read 572 times 12/2/2014 10:00:45 AM (last edit: 12/2/2014 10:00:45 AM)

Garp 
read 560 times 12/2/2014 1:04:37 PM (last edit: 12/2/2014 1:04:37 PM)

3joez 
read 549 times 12/2/2014 3:05:20 PM (last edit: 12/2/2014 3:05:20 PM)

Garp 
I don't mean to be rude but.. did you search? What I meant was that the question has been asked and answered, like, a million times all over the web.
read 540 times 12/2/2014 4:29:15 PM (last edit: 12/2/2014 4:29:15 PM)

3joez 
Yes. I'm still trying to figure that out. I don't find it easy, that's all. I should have mentioned that I'm trying to solve the problem in 2d space (from top view,for example).
So, from what I'm figuring out, the basic steps should be these (in pseudo code)
Given the two lines
LineA (ax,ay) (bx,by)
LineB (cx,cy) (dx,dy)
1. Get the direction vectors of the two lines vec1 = (bxax), (byay) vec2 = (dxcx), (dycy)
2. Generate a new vector from the previous two (I'm not sure about this) by subtracting them. vec3 = vec2  vec1
3. Stuck here. And I don't even know if I'm on the right track.
Here, more practically, I'm trying to implement this.
read 536 times 12/2/2014 4:43:41 PM (last edit: 12/2/2014 5:11:18 PM)

Nik Clark 
Lol, when answers on the net give you equations like this:
I still need help! :D
read 516 times 12/2/2014 5:22:17 PM (last edit: 12/2/2014 5:22:17 PM)

Garp 
http://www.pdas.com/lineint.html
The code in mxs is pretty much a copypaste.
read 510 times 12/2/2014 5:50:24 PM (last edit: 12/2/2014 5:50:24 PM)

3joez 
Since I want to understand and not just merely copy, I'll start to share some insights, as long as they become clearer.
First
Two line segments can be expressed, in 2d euclidean space, with the regular formula y = mx + b
For our purpose, we shall introduce in the formula two unknown points Ua and Ub
So the line now can be expressed with
L1 = firstPoint + Ua (secondPointfirstPoint) L2 = thirdPoint + Ub (fourthPointthirdPoint)
The point of intersection happens when those two equations are equal, so
firstPoint + Ua (secondPointfirstPoint) = thirdPoint + Ub (fourthPointsecondPoint)
firstPoint means x1(the x of the first point, first line) secondPoint means y1(the y of the first point, first line) thirdPoint means x2(the x of the second point, first line) and so forth
Isolating the unknown points you should have this
Which should give you the coordinates of the intersection.
Now, I don't know why somebody was using cross product. But this lead me to somewhere. It shouldn't be hard to translate into mxs.
EDIT At the end you should plug back the Ua and Ub into the equations
L1 = firstPoint + Ua (secondPointfirstPoint) L2 = thirdPoint + Ub (fourthPointthirdPoint)
Double edit
After some research, this looks like an algorythm to find the intersection point of two lines that are already intersecting. So, I'll start from scratch. Here, insert the owl gif back again.
read 483 times 12/3/2014 4:56:07 PM (last edit: 12/3/2014 5:18:05 PM)

Garp 
The form y = ax + b doesn't allow for vertical lines (parallel to the Y axis). ax + by = c should be preferred.
Once you have the two equations ax + by = c dx + ey = f the first thing to check is that ae  db is not zero. If it is, it means that the lines have the same slope (they're parallel). In which case, either there is no intersection point, or there are an infinity of them.
read 472 times 12/3/2014 5:47:29 PM (last edit: 12/3/2014 5:48:11 PM)


