First notice the right triangle in red. We need to find the adjacent and opposite sides of it.
Using trigonometry we know that the adjacent side of a triangle is
The hypotenuse is the magnitude of the vector
The object above is a scalar but is has the magnitude of the adjacent, now we just need to point it in the right direction without changing its length.
So we need a vector pointing in the direction of with length .
So lets normalize
Now lets combine these two to get
The last step comes from the geometric definition of the dot product.
To get the perpendicular side
We use the geometric fact that vectors is Euclidean space add via the parallelogram rule. This gives
now we just solve for