A straight line satisfies the following condition.
- $p>0$ is the length of the perpendicular on the line from the origin
- $\alpha$ is the angle made by this perpendicular with the positive $x$-axis.
Vectorically derive that the equation of this straight line is $$x \cos\alpha + y \sin\alpha =p$$

With some ideas I have made a figure. But not sure that the figure is correct. Please help me with this and the further derivation.
Let $P$ denote the point on the line that is closest to the origin.
Then $\vec{OP}=\begin{pmatrix} p\cos \alpha \\ p \sin \alpha\end{pmatrix}$
Let $R$ be an arbitrary point on the line, let $\vec{OR}=\begin{pmatrix} x \\ y\end{pmatrix}$
$\vec{PR}$ and $\vec{OP}$ are perpendicular, hence their inner product (or dot product) should give us $0$.
$$\vec{PR}.\vec{OP}=0$$ $$(\vec{OR}-\vec{OP}).\vec{OP}=0$$ $$\vec{OR}.\vec{OP}=\vec{OP}.\vec{OP}$$
$$xp\cos (\alpha)+yp\sin(\alpha)=p^2$$ $$x\cos(\alpha)+y\sin(\alpha)=p$$