Find the intersection of two vectors

Mahsa (view profile)

on 9 Oct 2013
Latest activity Answered by Walter Roberson

Walter Roberson (view profile)

on 10 Oct 2013

I have two pairs of point and vector in 2d and I should find its intersection. for example: p0=[0,0] vector_p0=[0,1] and p1=[-10,37.3205] vector_p1=[0.5;-0.866]

Products

No products are associated with this question.

Walter Roberson (view profile)

on 10 Oct 2013

So is that like

```x0 = 0 + 0 * t
y0 = 0 + 1 * t
x1 = -10 + 0.5 * t
y1 = 37.3205 - 0.866 * t
```

and you want to find the t such that x0 = x1 and y0 = y1 ?

If so, then you will have two equations in one unknown, and it will not be generally possible to find the solution.

0 + 0 * t is 0, so comparing that to x1, 0 = -10 * t/2 so t = 20 (exactly). Substituting into y0, we get that y0 = 0 + 1 * 20 = 20, and bringing that across to y1, we get that 20 = 37.3205 - 0.866 * 20. That leads to the conflict 20 = 20.0005.

If we guess that 0.866 is intended to represent 13/15 then 20 = P + 13/15*20 results in the solution P = 112/3 which is 37.3333 to 4 decimal places, not 37.3205.

Join the 15-year community celebration.

Play games and win prizes!

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi