First find a vector that is parallel to this line:

$$\vec{u} = \vec{b} - \vec{a} = (2,1,2) - (1,-1,0)$$ $$= (2-1, 1-(-1), 2-0)$$ $$= (1, 2, 2)$$

Then use the formula:

$$\frac{x - a_1}{u_1} = \frac{y - a_2}{u_2} = \frac{z - a_3}{u_3}$$
$$\rightarrow \frac{x - 1}{1} = \frac{y - (-1)}{2} = \frac{z - 0}{2}$$

Simplify:

$$x - 1 = \frac{y + 2}{2} = \frac{z}{2}$$

Note: If any component of \(\vec{u}\) is zero, one needs to restart from the vector equation of the line.



For more details, please contact me here.