The discussion revolves around calculating the new aircraft attitude angles (Heading, Pitch, and Bank) after a series of rotations, specifically focusing on the application of rotation matrices in 3D space. Participants explore the mathematical representation of these rotations and the extraction of new angles from the resultant rotation matrix.
Discussion Character
Technical explanation
Mathematical reasoning
Debate/contested
Main Points Raised
One participant presents an initial problem involving an aircraft's attitude and a subsequent yaw rotation, seeking to determine the new angles and the corresponding rotation matrices.
Another participant provides a method for applying the rotation matrices, emphasizing the need to apply them in reverse order due to the changing axes of the aircraft.
There is a discussion about the resulting vectors from the matrix multiplication representing the aircraft's new orientation in geographic coordinates.
A participant expresses confusion about the calculations and the significance of the resulting vectors, indicating a struggle to understand the extraction of Euler angles from the rotation matrix.
Further attempts to extract angles from the rotation matrix yield non-sensical results, leading to questions about the correctness of the approach and the nature of the rotations (intrinsic vs. extrinsic).
Another participant suggests that the problem may be simplified to a single rotation defined by Roll, Tilt, and Yaw, but expresses uncertainty about the implications of this simplification.
Areas of Agreement / Disagreement
Participants do not reach a consensus on the correct approach to extract the new aircraft attitude angles from the rotation matrices. Multiple competing views on the application of rotations and the interpretation of results remain unresolved.
Contextual Notes
Participants note potential issues with the definitions of rotations, the impact of intrinsic versus extrinsic rotations, and the relationship between changes in Pitch and Heading in the context of aircraft attitude.
#1
rpmc
8
0
Suppose an aircraft attitude is given by
Heading=040 degrees
Pitch=15 degrees Up
Bank=20 degrees left bank
And then the aircraft “yaws”, or rotates 30 degrees left about its yaw axis.
What are the new Heading, Pitch and Bank angles?
What do the rotation matrices look like that describe this sequence of four rotations, and how are the new attitude angles extracted from the resultant rotation matrix?
Apologies for posting an apparently easy question, but I have been trying for some time and still cannot solve it.
You can find the matrices for 3D rotation about an axis here. They are for rotations around x, y and z axes. In an aeroplane, the x (roll/bank) axis points forward along the fuselage, the y (pitch) points starboard and the z (yaw) points towards the bottom of the plane. This page is helpful in understanding those axes.
Start with the plane level and pointing north so that its x,y,z axes align with the geographic x,y,z axes. Then your four rotations need to be applied. A way to do this is to represent the plane's x,y,z axes by vectors that have coordinates (1 0 0), (0 1 0) and (0 0 1) respectively in the geographic coordinates. Then apply the four rotations. However, because the rotations are relative to the plane's axes - not the geographic ones, and the plane's axes change with each rotation, the trick is to apply them in the reverse order. A little mathematical fiddling shows that that produces the same result as applying them in the original order on transformed axes.
So you left-multiply each of the three plane axis vectors (as column vectors) by
Rz(-30) * Rx(-20) * Ry(15) * Rz(40)
The vectors that are the result of that multiplication give the plane's final orientation, in terms of the geographic coordinates.
I didn't check the calcs but that looks about right. The vector is the direction that the fuselage now points (the plane's roll(x) axis), in the world coordinates. You can see from the coords that it's just a bit to the East of North and pointing up a bit (remember that the positive z direction is down), which is what you'd expect from those movements.
By applying the same matrix multiplication to the other two basis vectors, you'll get the direction of the other two transformed plane axes (although only one of the two is needed to completely specify the orientation).
#4
rpmc
8
0
First off, Andre, thank you so much for taking the time to help me. Your efforts are greatly appreciated.
It is quite embarrassing to admit that I still do not understand this. I know that I am missing something very fundamental, doing something very wrong, but I don't see it yet.
Here's my interpretation of your suggestion:
Rotation #4: Final Yaw rotation around the airplane Y axis: 40 degrees counter clockwise = -40
Rotation #3: Aircraft Bank: 20 degrees left = -20
Rotation #2: Aircraft Pitch: 15 degrees up = 15
Rotation #1: Aircraft Heading = 040 degrees
Lastly, to explain how I am thinking about it, I have the idea stuck in my head that if I use 0 degrees for the final Yaw rotation, then I should be able to extract
(actually, a rotation matrix formed by the multiplication mmult(A,mmult(B,mmult(C:D))) "seems" to yield angles that make more sense, but I cannot get the fourth rotation, the final Yaw around the aircraft Y axis to work no matter what I try.)
Further, if I use 90 degrees for the final Yaw rotation, then the Pitch and Roll will flip and I will extract:
out of the "rotation matrix”. But, of course, I don’t.
The “answer” I need will be in the form of angles – the new aircraft attitude angles after the four rotations.
Apologies for taking so long to understand this, but I still don’t understand where I am going wrong.
Thank you again, and regards,
Bob
Last edited:
#5
rpmc
8
0
Ooops ... I was editing my last response when you posted ... Bob
#6
rpmc
8
0
Hmmm,
To make sure that I understand, when you say "You can see from the coords that it's just a bit to the East of North and pointing up a bit (remember that the positive z direction is down), which is what you'd expect from those movements.", you are looking at
and the resulting column vector 0.9089 ... 0.0944 ... -0.4062 looking along the aircraft x (fuselage) axis is what you describe. OK, that ought to give me Pitch and Heading, so I still need another elemental rotation to get Roll ...
I think I finally see the light! Let me work with this.
Thanks so much!
Bob
Last edited:
#7
rpmc
8
0
Andre,
This still isn’t working for me. Maybe it's wrapped up with intrinsic vs. extrinsic rotations and the actual nature of aircraft attitude angles as measured by the aircraft instruments (that's what I'm using as my "input"). I’m not sure.
As I view the problem, if the fourth rotation, the “Final Yaw” around the airplane Z axis, is zero, then a proper rotation matrix should return the given aircraft attitude angles. However, Rz(-30)*Rx(-20)*Ry(15)*Rz(0) doesn’t do that. Further, if I change Pitch up or down a few degrees, that matrix multiplication will change the Heading value also, which is not correct in an aircraft where Pitch change does not affect Heading.
So, is it correct that this problem reduces to a single rotation defined as
Roll = Rx(u): Angle u around the aircraft X axis
Tilt = Ry(v): Angle v around the aircraft Y axis
Yaw = Rz(w): Angle w around the aircraft Z axis
The resulting rotation matrix is Rz * Ry * Rx = RzRyRx
The given aircraft attitude is a column matrix Attitude (-20 Bank, 15 Pitch, 040 Heading)
Code:
Attitude
-20
15
40
The rotated Bank and Pitch is calculated by applying the matrix multiplication RzRyRx * Attitude. However, the resulting new Heading is defined as mod(Yaw(w) + Heading, 360). Now, a Yaw angle, w, of 90 degrees flips the Pitch and Bank, which is what I want.
But this seems a little awkward, or forced, and I still have to deal with the fact that Bank range is -180 to +180 but Pitch is just -90 to +90 and when they flip at Yaw = 90 degrees, I could have an issue to correct (rotated Pitch could exceed abs(90) so that needs to be adjusted). There are other issues, or adjustments, dealing with inverted flight to work out, too.
Thanks again for all of your help. I need to think about this a lot more. I have been searching for the elegant solution and I don't think I'm there yet.
You mentioned the value of thinking about this as a vector problem - a Point vector and a Top vector. I need to understand that approach. Maybe it is the way to go. In addition to your response to my other question in this forum, there is a short thread on this over at stackoverflow.com but the moderator shut it down because it was just math and not code.
if I change Pitch up or down a few degrees, that matrix multiplication will change the Heading value also, which is not correct in an aircraft where Pitch change does not affect Heading.
Are you sure? Consider a plane that is flying level, pitched flat, heading North-East, banked 45 degrees to Port. Now say it starts to pitch up (rotate around its transverse axis) and continues until it is pointing 45 degrees above the horizontal in the x-z plane. Then its heading is North. We ignore here the fact that the heading and pitch will have changed further as the bank makes the plane execute a curve around its yaw axis.
Pitch changes affect Heading, because Heading is an angle relative to the geo coordinate frame, whereas Pitch is a rotation around an axis of the plane's coordinate frame. We need to distinguish between Heading and Yaw. Yaw is a rotation around the plane's z/Yaw axis, and a pitch change (rotation around plane's y/Transverse axis) does not have a Yaw component because the plane's y and z axes are orthogonal. But the plane's y-axis is not orthogonal to the geo z axis if the plane is banked, so a pitch change will have a component that is a rotation around the geo z axis.
So, is it correct that this problem reduces to a single rotation defined as
Roll = Rx(u): Angle u around the aircraft X axis
Tilt = Ry(v): Angle v around the aircraft Y axis
Yaw = Rz(w): Angle w around the aircraft Z axis
Yes. Any sequence of rotations, however long, can be expressed as three successive rotations, one around each axis. So a plane's orientation can be expressed as three such rotations, starting with the plane's axes aligned with the geo axes. I think the usual order is Yaw then Pitch then Bank. The good thing about that order is that the Heading is set by the Yaw rotation and not altered by the subsequent Pitch and Bank (whereas it would be altered if it were Bank then Pitch). That sequence is usually implemented in the easier way of rotations around the fixed geo axes, in the reverse order: Bank then Pitch then Yaw.
The given aircraft attitude is a column matrix Attitude (-20 Bank, 15 Pitch, 040 Heading)
Yes that's the attitude before the 30 degree yaw. But because the yaw is around the plane's z axis, not the geo z axis, we can't just subtract 30 from the Heading. We need to do the matrix multiplications.
The rotated Bank and Pitch is calculated by applying the matrix multiplication RzRyRx * Attitude.
No. The rotation matrices are for applying to vectors in a Cartesian frame, not angle vectors. I find it easiest to work entirely with Cartesian vectors rather than angles, and then extract the H,P,B angles from the three attitude vectors at the very end.
To extract the angles BPH from attitude vectors, use the matrix equations:
where v(x,plane) and v(y,plane) are the plane's x and y-axis vectors.
You'll get a whole bunch of equations and putting them together judiciously allows you to solve for B, H and P. You only need to use a few of the equations.
#9
rpmc
8
0
Andre,
Thanks to your patient explanations, the light finally went on for me. I had a visualization problem. When I thought of the final Yaw rotation, I now realize I had always visualized it at Bank=0 or at Pitch=0, and in those two specific attitudes only, a 90 degree Yaw flips the Pitch and Bank, and the new Heading is old Heading plus Yaw.
This is what I have now. I hope it is finally correct. Using the elemental rotation matrices: