Finding trigonometric equations from 3D Figure I have the following Figure and equations:
Image of rotation angles
$$
\rho = \arctan(\frac{Ax}{\sqrt{Ay^{2} + Az^{2}}}) \tag{1} 
$$
$$
\phi = \arctan(\frac{Ay}{\sqrt{Ax^{2} + Az^{2}}}) \tag{2}
$$
$$
\theta = \arctan(\frac{\sqrt{Ax^{2} + Ay^{2}}}{Az}) \tag{3}
$$
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).

Let's say I am trying to find ρ (Equation 1), so if I consider Figure B:
p angle
According to Equation 1, Ax is opposite to ρ and $\sqrt{Ay^{2} + Az^{2}}$ adjacent to ρ, but looking at the drawing above I still don't know how, since Ax would be the hypotenuse.
Furthermore, to obtain $\sqrt{Ay^{2} + Az^{2}}$ I believe that this would have to be the hypotenuse of the triangle (because of Pythagora's theorem: $h^2=o^2+a^2$), but for Equation 1 to make sense, it should be adjacent to ρ, since $ρ = arctan(o/a)$ and not $ρ = arctan(o/h)$.
So what am I doing wrong to obtain Equations 1, 2 and 3?
Source of the equations and figure: https://www.thierry-lequeu.fr/data/AN3461.pdf
Another similar source that uses the same equations: https://www.analog.com/en/app-notes/an-1057.html

A tangent is what we normally think of as the ratio
$\dfrac{y}{x}$ in a cartesian plane.
In the first two cases, the divisor is the hypotenuse of a Pythagorean triple being used as what we would normally think of as the $\space x\space$
coordinate of another right triangle where whe numerator is what we normally think of as the $\space y \space$ coordinate.
In the third case, it is a hypotenuse (numberator) being use as a $\space y\space$ coordinate, and the divisor (Az) being used as the $\space x\space$ coordinate.
Suppose, for example, that $x=3$ and $y=4$ giving a hypotenuse of $\space 5\space$ for a denominator. Now, if the $\space z\space%$ coordinate is also $\space 5,\space$ we have a tangent of
$\space \dfrac{5}{5}=1\space$ and we have
$\arctan(1)=\dfrac{\pi}{4}=45˚.\quad$
