With monday.comâ€™s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

If I have two lines on a graphic, and for each line I have two coordiantes.

How can I get the coordinates of the intersection between the two in the most efficiant way possible ?

How can I get the coordinates of the intersection between the two in the most efficiant way possible ?

http://planetsourcecode.com/xq/ASP/txtCodeId.14558/lngWId.1/qx/vb/scripts/ShowCode.htm

x = ay + b

line 1:

x = 3y + 1

line 2:

x = 2y + 3

therefore:

3y + 1 = 2y + 3

((3y - 2y) = (3 - 1))

y = 2

x = 3(2) + 1

x = 7

The coordinates are x = 7, y = 2

The number beside the y controls the pitch. And the other number controls the height above the x-axis (or y?).

In terms of programming, you'll probably be able to do it all in one or two lines. All you really need is the a and b and do some formula against it to get y, then get x.

If your lines are controls, try this:

Private Sub Command1_Click()

k1 = (Line1.Y2 - Line1.Y1) / (Line1.X2 - Line1.X1)

c1 = Line1.Y1 - k1 * Line1.X1

k2 = (Line2.Y2 - Line2.Y1) / (Line2.X2 - Line2.X1)

c2 = Line2.Y1 - k2 * Line2.X1

x = (c2 - c1) / (k1 - k2)

y = k1 * x + c1

Print x, y

End Sub

x = ay + b

line 1:

x = 3y + 1

line 2:

x = 2y + 3

therefore:

3y + 1 = 2y + 3

((3y - 2y) = (3 - 1))

y = 2

x = 3(2) + 1

x = 7

The coordinates are x = 7, y = 2

The number beside the y controls the pitch. And the other number controls the height above the x-axis (or y?).

In terms of programming, you'll probably be able to do it all in one or two lines. All you really need is the a and b and do some formula against it to get y, then get x.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.

http://www.planetsourcecode.com/xq/ASP/txtCodeId.5365/lngWId.1/qx/vb/scripts/ShowCode.htm

;)