If u is orthogonal to v, then u · v = 0.0
We want: w = kv + u, with the condition that u is orthogonal to v. Using trigonometry:
Remember that unit vectors are used to represent orientation in 3D space. The orientation of v is vu. (In the picture, this happens to be horizontal, but that is just for convenience). Since cos θ is wu · vu, we have what we need:
kv = |w| (wu · vu) vu
This formula may look awful, but it is not. This part:
|w| (wu · vu)
is a scalar. It adjusts v to to required length. In the picture this is the length of the horizontal baby blue line.
The remaining part: vu, just says, "same orientation as v."