Points of intersection of two lines

1.2k Views Asked by At

I have two lines that are concurrents and I want to know the point of intersection between them. To find the point my algorithm performs the following equation and replacing the lambda found in one of the equations:

$$|\lambda| = \frac{|(\vec{v}_1 \times \vec{v}_2)|}{|((x, y, z) - (x_2, y_2, z_2)) \times \vec{v}_2|}$$ But when I solve the linear system I get points (-2 , 2, -7) and my program returns (4, 8, 3) to this line: $$ r: (x, y, z) = (1, 5, -2) + λ(3, 3, 5) $$ $$ s: (x, y, z) = (0, 0, 1) + \mu(1,-1, 4) $$


Why does it happen? What is correct? For other equations that I tested I got the same results in the program and in the linear system

**My problem was that it was run only positive lambda values. But I still have error with the following equation: $$ r: (x, y, z) = (8, 1, 9) + \lambda(2, -1, 3) $$ $$ s: (x, y, z) = (3, -4, 4) + \mu(1, -2, 2) $$

I have the point (7.6, 1.2, 8.4) and lambda = |0.19| but the resolution of the linear system I get (-2, 6, -6). Why this formula is not valid in this case?

2

There are 2 best solutions below

3
On BEST ANSWER

The correct answer is $(-2,2,-7)$, found at $\lambda=-1$ and $\mu=-2$. The erroneous point $(4,8,3)$ is found on the first line when you substitute $\lambda=1$. The problem is simply that you do not account for the sign of $\lambda$ in your first equation, so you found $\lambda=1$ instead of the correct $\lambda=-1$.

Also, your formula for $\lambda$ is upside down, which explains why you got $|\lambda|=0.2$ rather than the correct $|\lambda|=5$ in your post edit. The first case only happened to work out because you had $|\lambda|=1$.

1
On

Instead of that formula, solve the following three equations for $\lambda$ or $\mu$: $$\begin{cases}1+3\lambda=\mu & (1) \\ 5+3\lambda=-\mu & (2) \\ -2+5\lambda=1+4\mu & (3)\end{cases}$$ Subtracting $(2)$ from $(1)$ gives $-4=2\mu \iff \mu=-2$, so the point of intersection is $(-2,2,-7)$.