0

I need to calculate the position of two points on a coordinate system, but I'm not sure how this is called, so I can't find the answer.

Considering the image below, I have the coordinates for points A, B, C and z.

How do I find the coordinates of i1 and i2 ?

enter image description here

Hugo Delsing
  • 13,803
  • 5
  • 45
  • 72
  • Possible duplicate of [Algorithm for intersection of 2 lines?](https://stackoverflow.com/questions/4543506/algorithm-for-intersection-of-2-lines) – Vaughan Hilts Jun 06 '19 at 05:35
  • I've posted an answer -- I think it's a duplicate of the intersection of two lines assuming you're using a cartesian plane, just done twice. – Vaughan Hilts Jun 06 '19 at 05:36

2 Answers2

2

If CB line is horizontal (this is not stated clearly), then triangles ACB and AI1I2 are similar, so coordinate relations are very simple

I2.X = B.X + (A.X - B.X) * (z - B.Y) / (A.Y - B.Y)

and similar for I1

MBo
  • 77,366
  • 5
  • 53
  • 86
0

You are looking for the intersection of two linear lines in a Cartesian plane.

You have to solve it twice: since you have two lines. You need to solve...

  1. The intersection of "A, C" to the axis "I"
  2. The interaction of "A, B" to the axis "I"

You can do this using the modeled equation and "setting them" equal to each other and solve. You can find such an answer here: https://stackoverflow.com/a/4543530/1554844

Once you solve for both pairs, you have the "X" coordinates of both. You trivially have the "Y" since you are able to draw the line (think: a line drawn between both i points, they rest on the same Y, and since you are computing those values, you must know "Y" since it is your axis.)

Vaughan Hilts
  • 2,839
  • 1
  • 20
  • 39