Coincidents lines

40 Views Asked by At

My algorithm to determine whether two lines are coincident (which have been proven previously they are parallel) verifies the following equation:

$$ \dfrac{x - x_o}{a} = \dfrac{y - y_o}{b} = \dfrac{z - z_o}{c} = \lambda $$

$x$, $y$ and $z$ are pointsB from lineB which I want to check in lineA
But if the director vector (not null) of the line contains some coordinate equal to zero $(a, b, c)$ my algorithm it will be invalid.
So how do I proceed in this case? I want to avoid using linear systems

1

There are 1 best solutions below

4
On

$$ \frac{x-x_0} a = \frac{y-y_0} b \tag 1 $$ is equivalent to $$ b(x-x_0) = a(y-y_0) \tag 2 $$ unless $a$ or $b$ is $0$. But you have another equality: $$ \frac{y-y_0} b = \frac{z-z_0} c \tag 3 $$ equivalent (unless $b$ or $c$ is $0$) to $$ c(y-y_0) = b(z-z_0). \tag 4 $$ Similarly we get $$ c(x-x_0) = a(z-z_0). \tag 5 $$ In cases where two of the three coefficients are $0$, one should check all three of $(2)$, $(4)$, and $(5)$.