The parametric equations for a line in 3D space can be written as, (using P)

`x = x_1+at`

`y = y_1+bt`

`z = z_1+ct`

Now Q is also on the same line (with a different parameter value)

`x_2 = x_1+at'`

`y_2 = y_1+bt'`

`z_2 = z_1+ct'`

Solving for a using both x equations,

`(x-x_1)/t = (x_2-x_1)/(t')`

Now this gives,

`(x-x_1)/(x_2-x_1) = t/(t') = m`

From y and z equations also,

`(y-y_1)/(y_2-y_1) = t/(t') = m`

`(z-z_1)/(z_2-z_1) = t/(t') = m`

Therefore we write the two point formula as below,

`(x-x_1)/(x_2-x_1) = (y-y_1)/(y_2-y_1) = (y-y_1)/(y_2-y_1) = m`

Rearranging the above three equations will give us the parametric equation with `m` as a parameter.

`x = x_1+m(x_2-x_1)`

`y = y_1+m(y_2-y_1)`

`z = z_1+m(z_2-z_1)`

These are the required equations.

**Further Reading**