Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

308
Vistas
Trigonometry calculate tilt angle from accelerometer data

I have the following Figure and the equations:

Three Axis for measuring tilt

Equations for measuring tilt

The body on the Figures is a tri-axial accelerometer sensor, which measures accelaration in meters/seconds².

The goal is to calculate the tilt of the following angles using acceleration values:

  • ρ: angle of the X-axis relative to the ground (orange line);
  • Φ: angle of the Y-axis relative to the ground (orange line);
  • θ: angle of the Z-axis relative to the gravity (green line).

Could someone explain how to find equations 1,2 and 3 from the figure above?

Source of the equations and figure: https://www.thierry-lequeu.fr/data/AN3461.pdf

There is another similar and more detailed source that uses the same equations, but I also could not understand how to find them: https://www.analog.com/en/app-notes/an-1057.html

I have already implemented them and it is working, I just want help to understand how to obtain the equations. Here is the code:

let pitch = Math.atan(ax / Math.sqrt((Math.pow(ay,2) + Math.pow(az,2))) );
let roll = Math.atan(ay / Math.sqrt((Math.pow(ax,2) + Math.pow(az,2))) );
let theta = Math.atan(Math.sqrt((Math.pow(ax,2) + Math.pow(ay,2))) /az);

Thanks in advance.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

This is the Pythagorean theorem, finding the 2D distance between 0,0 and a point represented by the two numbers given. If we assign that to a new function it may be clearer:

distance(a, b) { return sqrt((pow(a,2) + pow(b,2))) }

Then angles are calculated by using the inverse tangent function with a distance from that function representing one side of the triangle. For example, the pitch in your question divides the x acceleration by the distance between 0,0 and the acceleration in the YZ plane.

pitch = atan(x / distance(y, z))
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda