Hi Pvand2019, the general formulas are described below to get the gravity vector in the sensor frame (typically device/object frame). gravityVectorNED = [0 0 1]; rotationNED2SF= conjugate(rotationVector) gravitySF = rotation NED2SF ∙ gravityVectorNED ∙ rotationNED2SF-1 Since we are using unit quaternions for the rotations, the inverse of the rotationNED2SF is equal to the conjugate of the quaternion. The operator ∙ is defined as the quaternion multiplication. The final equation would be this: grav_x = 2*(rv_x *rv_z - rv_w * rv_y) grav_y = 2*(rv_y*rv_z + rv_w*rv_x) grav_z = rv_w*rv_w - rv_x*rv_x - rv_y*rv_y - rv_z* rv_z Hope this helps, Regards, kgoveas
... View more