0
$\begingroup$

I'm reading the book 3d Math Primer for Graphics and Game Development 1st edition by Fletcher Dunn and Ian Parberry. On page 61 there's this:

enter image description here

How does it derive $ v_{||} $ there? It doesn't follow from what preceded this point in the book, unless I'm missing something. Also I'm not sure, is $n$ supposed to be unit vector here? This should probably be in the errata but I didn't find anything. Anyway, how did he deduce this equation? Thanks in advance.

$\endgroup$

2 Answers 2

1
$\begingroup$

Since v∥ is parallel to n, it can be expressed as some multiple of n. The multiple is the ratio of the length of v∥ to the length of n. The n vector doesn’t have to be normalized, but if it is, then |n| is 1, so the equation becomes v∥ = n * |v∥|.

$\endgroup$
1
$\begingroup$

Since we have:

$$\pmb{v}_{\parallel} \parallel \pmb{n},$$

then:

$$\pmb{v}_{\parallel} = k\pmb{n}$$

We want that the length of $\pmb{v}_{\parallel}$ is $\|\pmb{v}_{\parallel}\|$, then:

$$\|\pmb{v}_{\parallel}\| =|k|\|\pmb{n}\| \implies |k| = \frac{\|\pmb{v}_{\parallel}\|}{\|\pmb{n}\|}$$

Then the sign of $k$ is simply chosen to match the direction of $\pmb{v}$ (if the angle between $\pmb{v}$ and $\pmb{n}$ is more than 90 degrees, the sign is negative, otherwise it is positive).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.