Spherical coordinates of a unit vector around a normal $N$

756 Views Asked by At

So if I have a unit normal for a surface $N(x,y,z)$ and an incident unit vector $V(x,y,z)$ to that surface, how would I represent the vector V in spherical coordinates relative to the normal?

1

There are 1 best solutions below

0
On

The radius is 1 since your vector $v$ is normalized. To get the angle between $v$ and $n$ use the dot product of the vectors which gives you the cosine. Then using the arc cosine gives you an angle between 0 and $\pi$. For the other angle, you will need a vector $t$ of the tangent plane as reference. First project $v$ in the tangent plane as $v_t= v-(v.n)n$. Since the angle in this plane is in $[0,2\pi]$ you will also need the sign of the sine between the vectors. You get it with the cross product $t \times v_t$ which gives you a vector whose length is the sine of the angle between $t$ and $v_t$ times the norm of $v_t$, and the sign of the dot product between this vector and the normal is positive if the angle is in $[0,\pi]$ and negative if it is in $[\pi,2\pi]$. With $\arccos{(\frac{v_t.t}{\lVert v_t \rVert})}$ you get an angle, and using the previous sign you get the angle between 0 and $2\pi$.