01
Tait-Bryan angles
Tait-Bryan angles are a particular three-angle parametrization of rotations, closely related to Euler angles [1]. They are utilised in aerospace applications to depict the aircraft's orientation in relation to the 3D world frame. In this site, the Tait-Bryan angles are utilised to define the position of a 3D beam, or only of an infinitely small segment of a beam, in the global 3D reference frame.
The local reference frame of a beam, or of an infinitely short segment of a curved beam, is defined like this: -axis is the locus of the centres of gravity of its cross-sections, -axis and -axis are the principal axes of its cross-section. The Tait-Bryan angles are presented in the figures below, [1].

We assume that the local reference frame is obtained as follows: initially the local frame coincides with the global one: the beam lies on the global -axis and global -axis and -axis are parallel to the principal axes of its cross-sections. We apply three consecutive rotations. On this site, we prefer the order yaw, pitch and roll (called ):
- a rotation of angle around the global axis, → “yaw”
- a rotation of angle around the new axis (denoted ), → “pitch”
- finally a rotation with angle around the newest axis (let's call it ). → “roll”
In this section, is used as the passive transformation matrix from global components to local components. Positive rotation angles follow the right-hand rule and are defined successively, starting from the global reference frame and then with respect to the rotated reference frames.

02
The rotation matrix
In the following, the rotation matrix is defined according to the convention adopted on this site for transforming between the global and local reference frames.
With this convention, the rotation matrix is:
or finally:
03
Two Tait-Bryan solutions
If we know the Tait-Bryan angles it is very easy to find the rotation matrix . But computing the angles from the rotation matrix is more difficult. It will now be shown how this operation can be performed, [2].
First, the angle can be easily found. In fact, there are two solutions:
Then the angle can be found out by noting that:
Or better, using the Matlab command atan2:
atan2 is a four-quadrant inverse tangent, that is the angle results in the interval . Here we have to pay attention to the sign of : when the angle is as shown above, but if :
This issue is easily solved by writing this line like this:
In a similar manner, we can calculate the angle :
In conclusion, in general, we get two different solutions: and . Both are valid!
04
Gimbal lock
The special case , corresponding to , is known as gimbal lock. In this configuration, two rotation axes become aligned, so yaw and roll can no longer be determined independently.
In the particular case there are two possibilities: or .
When the rotation matrix becomes:
In this case, it results:
The angle can have any value. We prefer to choose and the angle will thus result.
When the rotation matrix becomes:
and therefore:
05
MATLAB subprogram
A simple Matlab subprogram is given below.
function [tb1 tb2] = R2TB(R)
%Convert rotation matrix R to Tait-Bryan angles tb1 and tb2
tol = 1e-12;
if abs(abs(R(1,3))-1) > tol
theta1=asin(-R(1,3));
ct=cos(theta1);
psi1=atan2(R(1,2)/ct,R(1,1)/ct);
phi1=atan2(R(2,3)/ct,R(3,3)/ct);
tb1=[psi1 theta1 phi1];
theta2=pi-theta1;
ct=cos(theta2);
psi2=atan2(R(1,2)/ct,R(1,1)/ct);
phi2=atan2(R(2,3)/ct,R(3,3)/ct);
tb2=[psi2 theta2 phi2];
elseif abs(R(1,3)+1) <= tol
theta1=pi/2;
phi1=0;
psi1=atan2(R(3,2),R(3,1));
tb1=[psi1 theta1 phi1];
tb2=tb1;
elseif abs(R(1,3)-1) <= tol
theta1=-pi/2;
phi1=0;
psi1=atan2(-R(3,2),-R(3,1));
tb1=[psi1 theta1 phi1];
tb2=tb1;
end06
References
[2] Slabaugh, G. G., “Computing Euler Angles from a Rotation Matrix,” Technical Report, 1999.