So I'm currently attempting to project a 3D Vector (obtained from an accelerometer) into the object orientation (obtained by integrating the angular velocity obtained from the object gyroscope, returned as a 3D Vector). However I'm not really sure how to do that.
I'm using an Excel spreadsheet right now to know which results I can expect from the test data to be imported into the software I'm working on.
Projecting a vector v onto another vector p is as simple as computing the dot product of the former with a unit length vector in the direction of the latter np:
vp = (v.np)np = (v.p / ||p||2)p
Component-wise that is:
The length of the projection itself is v.np, which is equal to
vdp / sqrt(p2)
.