Bank angle from horizon frame?

  • Thread starter Artlav
  • Start date
  • #1
Artlav
162
0
How can i find out aircraft's bank angle knowing it's local frame in horizon frame?

Specifically, the horizon frame is y for up, z for north, x for east, the plane frame is x for right wing-wards, z for nose-wards, y for up. I know unit vectors of plane frame in horizon frame, and want to find out bank angle from them.

The best attempt yet is:
npr=normalize(z_horizon.x,0,z_horizon.z);
rh=normalize(y_horizon-(npr*scalar(npr,y_horizon)));
bank=sign(x_horizon.y)*atan2(sqrt(sqr(rh.x)+sqr(rh.z)),rh.y);

Basically, trying to subtract the projection of the up onto the forward from the up and compute the angle to horizon plane, but it does not work right if pitched and banked.

Any help?
 

Answers and Replies

  • #2
Artlav
162
0
Solved it.
Project the up vector onto the plane whose normal is the nose vector, then compute the angle between the resulting reference vector and the actual up vector, correcting for sign thru wing vector.

ref=normalize((0,1,0)-(z_horizon*scalar((0,1,0),z_horizon)));
sm=scalar(ref,y_horizon);
if abs(sm)>=1 then ac=0; else ac=arccos(sm);
bank=sign(x_horizon.y)*ac;
 

Suggested for: Bank angle from horizon frame?

  • Last Post
Replies
6
Views
8K
  • Last Post
Replies
4
Views
9K
Replies
6
Views
2K
  • Last Post
Replies
3
Views
530
Replies
3
Views
1K
Replies
8
Views
1K
  • Last Post
Replies
2
Views
1K
  • Last Post
Replies
9
Views
905
Top