I am trying to develop a function to determine if 2 planes are parallel or not.
I have their equations :
P1 : a1.x + b1.y + c1.z + d1 = 0
P2 : a2.x + b2.y + c2.z + d1 = 0
I check :
a1=0 & a2=0 => parallel
b1=0 & b2=0 => parallel
c1=0 & c2=0 => parallel
else, if a1/a2 = b1/b2 = c1/c2 => parallel
I have some big doubts about it, because I read on courses that none of parameters may be equal to 0, but if I have a plane on $(x,y)$, with $z=10$, the equation may be :
$z-10 = 0$, so $a, b =0$, right?
How could I check parallelism, taking in account each particular case?
After thinking, I guess it may be something like that :
(a1=0 & a2=0) => no need to check equality
(b1=0 & b2=0) => no need to check equality
(c1=0 & c2=0) => no need to check equality
if (a1=0 & a2!=0) or (a1!=0 & a2=0) => not parallel
if (b1=0 & b2!=0) or (b1!=0 & b2=0) => not parallel
if (c1=0 & c2!=0) or (c1!=0 & c2=0) => not parallel
Where != means different
Then check if a1/a2 = b1/b2 = c1/c2 (if I need to check)
Aside : How can I insert here some mathematical signs, I cannot find?
If a plane $P$ has $ax+by+cz+d=0$ as cartesian equation —with $(a,b,c)\ne(0,0,0)$—, then the vector $\left(\begin{smallmatrix} a\\ b\\ c \end{smallmatrix}\right)$ is orthogonal to $P$.
Now two planes $P_1$ and $P_2$ are parallel iff $\left(\begin{smallmatrix} a_1\\ b_1\\ c_1 \end{smallmatrix}\right)$ and $\left(\begin{smallmatrix} a_2\\ b_2\\ c_2 \end{smallmatrix}\right)$ are “proportional”, i.e., linearly dependent, which is in turn equivalent to $$\begin{vmatrix} a_1&a_2\\ b_1&b_2 \end{vmatrix} = \begin{vmatrix} a_1&a_2\\ c_1&c_2 \end{vmatrix} = \begin{vmatrix} b_1&b_2\\ c_1&c_2 \end{vmatrix}=0.$$ That is: $a_1b_2-a_2b_1 =a_1c_2-a_2c_1 =b_1c_2-b_2c_1=0$.