Normal vector of a rotated cell phone

82 Views Asked by At

Every cell phone reports 3 angles of azimuth, pitch and roll at any orientation. I am wondering how to find the normal vector of the cell phone based on theses three angles?

Thanks in advance.

1

There are 1 best solutions below

6
On

Let $\alpha$, $\phi$ and $\rho$ be the respective azimuth, pitch and roll, the normal vector may be

$\vec {n}(\alpha, \phi, \rho) = (\sin \phi*\cos \alpha, \sin \rho*\cos \alpha, \cos \phi *cos \rho)$

I'm thinking as if I had my cell phone over some surface with the screen upwards and the $z$ axis is normal to the screen, the $x$ axis is pointng down, and the $y$ is pointing right.

For example,

$\vec {n}( 0, 0, 0) = (0 ,0, 1)$

$\vec {n}( 0,90, 0) = (1 ,0, 0)$

$\vec {n}( 0, 0,90) = (0 ,1, 0)$

In degrees.

EDIT:

When I gave the main answer it took me a purely geometrical/intuitive interpretation, although I think we may get to the answer interpreting the phone screen as a plane, parallel to the $xy$ plane.

The screen plane may be written as:

$ax + by + cz + d = 0,\: d=0$

And a vector $\vec{n}$ normal to this screen plane is:

$\vec{n}(x,y,z) = (a, b, c)\: \forall x,y,z$

Further research over plane rotations may bring you the answer.

My way of thinking:

Our $z$ component will depend only on the pitch and roll angles, since azimuthal rotation doesn't take effect over the $z$ component of $\vec{n}$.

Since $c = 1\:$ when $\phi = 0$ and $\rho = 0 $ and also $c = 0\:$ when $\phi = 90$ or $\rho = 90$ we could think $c$ as $c = \cos \phi*\cos \rho$

And it took me a similiar path for the other components.