Determination of angle of deviation and rotation of the vector

142 Views Asked by At

I'm sorry for my drawing skills and mistakes in grammar.

I'm trying to solve next task:

Phone is somehow fixed in a phoneholder in a car. As it is displayed on picture. Purple - car coordinate system, red - phone's one.

X - perpendicular to the movement and parallel to the ground
Y - parallel to the movement and to the ground
Z - perpendicular to the ground

During the calibration phase I can assume, that all measured acceleration belongs to single axis - Y. So I have two vectors:

Measured acceleration (ma) - [x, y, z]
Expected acceleration (ea) - [0, |ma|, 0]

How can I calculate rotation matrix, angles or something else I don't know about, to transform measured (phone) acceleration to expected (car)?

example