<s>[INST] Equation for Distance of the Straight line from the Origin. By reduction of the equation $ax + by + c = 0 $ of a straight line to the normal form , we get 
$$\left(\frac{-a}{\sqrt{a^2 + b^2}}\right)x + \left(\frac{-b}{\sqrt{a^2 + b^2}}\right)y = \frac{c}{\sqrt{a^2 + b^2}}$$
And,
$$p= \frac{∣c∣}{\sqrt{a^2 + b^2}}$$
And my textbook says that $p$ is the distance of the straight line from the origin. I don't know why we are getting it as a distance from origin?
I know $p= x\cos\theta + y\sin\theta$ ( where $p$ is distance of line from origin).
Also I want to know how can we relate both equations?
 [/INST] By simple identification, the two equations are identical when
$$-\frac a{\sqrt{a^2+b^2}}=\cos\theta,\\
-\frac b{\sqrt{a^2+b^2}}=\sin\theta,\\
\frac c{\sqrt{a^2+b^2}}=p.$$
This is coherent as you verify $\cos^2\theta+\sin^2\theta=1$. If $c$ is negative, change all signs.

As one can verify by substitution,
$$x=p\cos\theta-t\sin\theta,\\y=p\sin\theta+t\cos\theta.$$ describes any point along the line, by varying $t$.
The distance from the origin to this point is given by, after simplification,
$$d=\sqrt{x^2+y^2}=\sqrt{p^2+t^2}.$$
The minimum value is indeed $p$.
</s>