3d rotation of accelerometer vectors

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 7K views
IMK
Messages
61
Reaction score
0
Hello,

I have some accelerometer vector data A (3d vectors x,y,z ) than I have normalized so I guess they are unit vectors. Now what I what to do is to 3d rotate them by another set of normalized accelerometer vector data B so I get a third set of vectors D.

I have tried a simple vector subtraction but this does not seem to work, so can you tell me please what math method I should be using for the please?

Is it Euler angles, Cartesian etc etc.

A method of how to do it would be wonderful, and I know this is not a programming forum but if anyone knows of some c/c++ source for this is would be great.
Many thanks IMK
 
Physics news on Phys.org
Not quite sure what you mean by a rotation by three vectors. I assume a rotation along one axis, then another and finally a third one. Express these three rotations in an Cartesian standard frame: an orthonormal system ##x,y,z##. Then build a matrix ##A## with your initial vectors as columns. One rotation is then a matrix multiplication from the left with a rotation matrix ##R_i##. The result is then ##R_3R_2R_1A##.

The first step, expressing your rotations in an ##x,y,z## frame is, because rotations along these axis are especially easy. You can look them up on Wikipedia for instance.