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 ds 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: xˉ-axis is the locus of the centres of gravity of its cross-sections, yˉ-axis and zˉ-axis are the principal axes of its cross-section. The Tait-Bryan angles are presented in the figures below, [1].
Figure 1. Tait-Bryan angles for a beam segment and an aircraft.
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 x-axis and global y-axis and z-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 zy′x′′):
a rotation of angle ψ around the global z axis, → “yaw”
a rotation of angle θ around the new y axis (denoted y′), → “pitch”
finally a rotation with φ angle around the newest x axis (let's call it x′′). → “roll”
In this section, R 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.
Figure 2. Yaw, pitch and roll axes.
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.
If we know the Tait-Bryan angles it is very easy to find the rotation matrix R. But computing the angles from the rotation matrix R 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:
θ1=sin−1(−R(1,3))andθ2=π−θ1
Then the angle ψ can be found out by noting that:
tanψ=R(1,1)R(1,2)
Or better, using the MATLAB command atan2:
ψ=atan2(R(1,2),R(1,1))
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 cosθ: when cosθ>0 the angle ψ is as shown above, but if cosθ<0:
ψ=atan2(−R(1,2),−R(1,1))
This issue is easily solved by writing this line like this:
ψ1,2=atan2(cosθ1,2R(1,2),cosθ1,2R(1,1))
In a similar manner, we can calculate the angle φ:
φ1,2=atan2(cosθ1,2R(2,3),cosθ1,2R(3,3))
In conclusion, in general, we get two different solutions: (ψ1θ1φ1) and (ψ2θ2φ2). Both are valid!
04
Gimbal lock
The special case cosθ=0, corresponding to θ=±π/2, 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 cosθ=0 there are two possibilities: θ=π/2 or θ=−π/2.
When θ=π/2 the rotation matrix R becomes:
R=0−sin(ψ−φ)cos(ψ−φ)0cos(ψ−φ)sin(ψ−φ)−100
In this case, it results:
ψ−φ=atan2(R(3,2),R(3,1))
The angle φ can have any value. We prefer to choose φ=0 and the angle ψ will thus result.
When θ=−π/2 the rotation matrix R becomes:
R=0−sin(ψ+φ)−cos(ψ+φ)0cos(ψ+φ)−sin(ψ+φ)100
and therefore:
ψ+φ=atan2(−R(3,2),−R(3,1))
05
MATLAB subprogram
A simple MATLAB subprogram is given below.
R2TB
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;
end