Find the intersection of a line formed by the intersection of two planes $\vec r . \vec n_1 = p_1 $ and $\vec r . \vec n_2=p_2$.
I know that the line would be along $(\vec n_1 \times \vec n_2)$. So i need a point on the line to get the equation. I assumed a point $ C$ such that $\vec {OC}$ is perpendicular to the line of intersection. I dont really know how to proceed from here. Do I have to use the equations $\vec c . \vec n_1 = p_1 $ and $\vec c . \vec n_2=p_2$?
You know that the line is of the form $t(n_1\times n_2)+p$ for some point $p$. Now to find $p$, we can assume it is of the form $an_1+bn_2$ (since the line is perpendicular to $n_1$ and $n_2$, so it must pass through the plane spanned by them somewhere). Then since $p$ is in both planes, we have the equations $p\cdot n_1=a+bn_1\cdot n_2=p_1$, and $p\cdot n_2=an_1\cdot n_2 + b=p_2$. This gives us the system of equations $$\newcommand\bmat{\begin{pmatrix}}\newcommand\emat{\end{pmatrix}}\bmat 1 & n_1\cdot n_2 \\ n_1\cdot n_2 & 1 \emat \bmat a \\ b\emat = \bmat p_1\\p_2\emat.$$ The determinant of the matrix is $1-(n_1\cdot n_2)^2$, and since $n_1$ and $n_2$ are not parallel (since the planes intersect in a line, so they are not themselves parallel), this is positive. Hence we can invert the matrix to get $$\bmat a \\ b \emat = \frac{1}{1-(n_1\cdot n_2)^2}\bmat 1 & -n_1\cdot n_2 \\ -n_1\cdot n_2 & 1\emat\bmat p_1\\p_2\emat,$$ or letting $n_1\cdot n_2 = \alpha$, $$a = \frac{p_1-\alpha p_2}{1-\alpha^2},$$ and $$b=\frac{p_2-\alpha p_1}{1-\alpha^2}.$$