Let the equation of the line passing through the origin be $y=m_{1}x$,where $m_{1} = \frac{y}{x}$.
If this line makes an angle $\theta$ with the line $y=mx+c$,then the angle $\theta$ between them is given by the formula:
$\tan \theta = \left| \frac{m_{1}-m}{1+m_{1}m} \right|$
Substituting $m_{1} = \frac{y}{x}$:
$\tan \theta = \left| \frac{\frac{y}{x}-m}{1+\frac{y}{x}m} \right|$
Removing the modulus gives two cases:
Case $I$: $\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 m + \tan \theta = \frac{y}{x}(1 - m \tan \theta)$
$\Rightarrow \frac{y}{x} = \frac{m + \tan \theta}{1 - m \tan \theta}$
Case $II$: $-\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 m - \tan \theta = \frac{y}{x}(1 + m \tan \theta)$
$\Rightarrow \frac{y}{x} = \frac{m - \tan \theta}{1 + m \tan \theta}$
Combining both cases,the required equation is $\frac{y}{x} = \frac{m \pm \tan \theta}{1 \mp m \tan \theta}$.