Show that the equation of the line passing through the origin and makingĀ an angle $\theta w i t h$ the line $y=m x+c$ is $\frac{y}{x}=\frac{m \pm \tan \theta}{1 \mp m \tan \theta}$.
Let the equation of the line passing through the origin be $y=m_{1} x$.
If this line makes an angle of $\theta$ with line $y=m x+c$, then angle $\theta$ is given by
$\therefore \tan \theta=\left|\frac{\mathrm{m}_{1}-\mathrm{m}}{1+\mathrm{m}_{1} \mathrm{~m}}\right|$
$\Rightarrow \tan \theta=\left|\frac{\frac{\mathrm{y}}{\mathrm{x}}-\mathrm{m}}{1+\frac{\mathrm{y}}{\mathrm{x}} \mathrm{m}}\right|$
$\Rightarrow \tan \theta=\pm\left(\frac{\frac{\mathrm{y}}{\mathrm{x}}-\mathrm{m}}{1+\frac{\mathrm{y}}{\mathrm{x}} \mathrm{m}}\right)$
$\Rightarrow \tan \theta=\frac{\frac{y}{x}-m}{1+\frac{y}{x} m}$ or $\tan \theta=-\left(\frac{\frac{y}{x}-m}{1+\frac{y}{x} m}\right)$
Case I: $\tan \theta=\frac{\frac{\mathrm{y}}{\mathrm{x}}-\mathrm{m}}{1+\frac{\mathrm{y}}{\mathrm{x}} \mathrm{m}}$
$\tan \theta=\frac{\frac{y}{x}-m}{1+\frac{y}{x} m}$
$\Rightarrow \tan \theta+\frac{y}{x} m \tan \theta=\frac{y}{x}-m$
$\Rightarrow \mathrm{m}+\tan \theta=\frac{\mathrm{y}}{\mathrm{x}}(1-\mathrm{m} \tan \theta)$
$\Rightarrow \frac{y}{x}=\frac{m+\tan \theta}{1-m \tan \theta}$
Case II: $\tan \theta=-\left(\frac{\frac{y}{x}-m}{1+\frac{y}{x} m}\right)$
$\tan \theta=-\left(\frac{\frac{\mathrm{y}}{\mathrm{x}}-\mathrm{m}}{1+\frac{\mathrm{y}}{\mathrm{x}} \mathrm{m}}\right)$
$\Rightarrow \tan \theta+\frac{y}{x} m \tan \theta=-\frac{y}{x}+m$
$\Rightarrow \frac{\mathrm{y}}{\mathrm{x}}(1+\mathrm{m} \tan \theta)=\mathrm{m}-\tan \theta$
$\Rightarrow \frac{y}{x}=\frac{m-\tan \theta}{1+m \tan \theta}$
Therefore, the required line is given by $\frac{\mathrm{y}}{\mathrm{x}}=\frac{\mathrm{m} \pm \tan \theta}{1 \mp \mathrm{m} \tan \theta}$.