# Finding Acceleration Force of Gravity on Rotated Accelerometer

Is it possible to calculate the force of gravity on the $x$, $y$, and $z$ readings of an accelerometer if I know the rotation of the sensor? If so, how would I do this?

Sorry if I am doing this wrong, this is my first post on this SE site (I spend a lot of time over at SO).

• Are you asking about an application in space, or an application that needs to deal with minor variations in the Earth's gravity at its surface? Or is the application something which takes place on the Earth's surface, and the minor variations in the Earth's gravity at its surface are irrelevant? The answer might be "it's impossible", or it might just involve a coordinate transformation of a known acceleration vector, depending on the details of the application involved. Commented Sep 4, 2014 at 1:21

Not sure I understand your question. Let me know if the answer doesn't make sense.

When a accelerometer is in a given orientation to the direction of gravity, then the value measured on each axis is the dot product of the gravity vector and the orientation vector of the sensor. Imagine that you start with the sensor in the "normal" orientation: X points in (1 0 0), Y points in (0 1 0) and Z points in (0 0 1). The acceleration of gravity points along the Z axis: (0 0 -g). You can see that the dot product of the X and Y vectors with the gravity vector are zero - and the Z sensor reads $-g$.

Now rotate the sensor to an arbitrary orientation. If you rotated 45 degrees about the X axis, your sensor axes would point:

X = (1  0  0)
Y = (0  r -r)
Z = (0  r  r)


where $r=\sqrt{2}$. And now you would see a gravity value on both the Y and Z axes of the sensor. The total gravity is of course the vector sum of the components in X,Y,Z.

The above should allow you to subtract the gravity vector from a reading, so you can obtain the "other" acceleration of the system.

Let me know if this is clear enough.