I'm trying to write a small function in C++ that calculates the Unit Normal of a Vector, however I'm stuck with the formula to do so as I feel like I'm missing out on something.
Let's say I have a point in 3D space: (2.0, 3.0, 6.0)
I will be using the formula a = dn
To calculate d I use d = |a| = √2.0² + 3.0² + 3.0² = 7.0
then we have n = 1/d
So n = 1/7.0, and dn = 1 (dn equals a magnitude of 1)
This is how I think I'm meant to calculate the Unit Normal of the vector, is this correct? Is the value of dn my answer, or is there another step?