# How can I prove $x \cos\alpha + y \sin\alpha =p$ using vectors?

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$$

• where is 'R' in the figure? Could you show me please – pi-π Dec 25 '16 at 3:46
• $R$ is an arbitrary point on the line $AB$. – Siong Thye Goh Dec 25 '16 at 4:11

Firstly, you haven't marked the angle $\alpha$ in your diagram though it is implicit from your question.

Once you mark $\alpha$ express $\cos(\alpha)$ and $\sin(\alpha)$ in terms of the distances in the figure.

Hint: $$\cos(\alpha) = \frac{PO}{OA}$$

• What do you mean by vector method? Using $\hat{i}$ etc? @user354073 – Rama Dec 4 '16 at 15:48
• Yes. Using the algebraic vector forms like $\vec {i}$ and $\vec {j}$. – pi-π Dec 4 '16 at 16:33