How did the author find the vector v prime perpendicular to n

148 Views Asked by At

I'm reading the $3D$ Math Primer for Graphics and Game Development by Fletcher Dunn and Ian Parberry, but I've gotten stuck.

If you look at the attached image where it says, "Now we can see the portion of $v$ prime perpendicular to $n$ is given by: .."

How does "$\cos(\theta v_{\perp}) + \sin(\theta w) = v'_{\perp}$"?

Do let me know, if additional information is needed.

enter image description here

1

There are 1 best solutions below

4
On BEST ANSWER

It may help to consider the 2D case. To keep things simpler, I'll use $\mathbf{v}$ in place of $\mathbf{v_\perp}$

Let $\mathbf{v} = (r \cos\alpha, r \sin\alpha)$

w is obtained by rotating v around the origin by 90°, so

$\mathbf{w} = (-r \sin\alpha, r \cos\alpha)$

Now, we rotate v by $\theta$ to obtain v', so

$$\begin{align} \mathbf{v^\prime} & = (r\cos(\alpha + \theta), r\sin(\alpha + \theta)) \\ & = (r\cos\alpha\cos\theta - r\sin\alpha\sin\theta, r\sin\alpha\cos\theta + \cos\alpha\sin\theta) \\ & = \cos\theta(r\cos\alpha, r\sin\alpha) + \sin\theta(-r\sin\alpha, r\cos\alpha) \\ \mathbf{v^\prime} & = \cos\theta\mathbf{v} + \sin\theta\mathbf{w} \end{align}$$