1
0
Fork 0

Formatting changes

This commit is contained in:
daveluff 2003-10-07 13:01:18 +00:00
parent 1a2ee0a908
commit 824f78f255

View file

@ -319,7 +319,7 @@ void FGApproach::Update(double dt) {
// ===================================================================
if ( planes[i].wpn == 2 && planes[i].dnwp < planes[i].spd/60.*2.0 ) {
double freq = 121.95;
double freq = 121.95; // Hardwired - FIXME
// generate message
code.c1 = 1;
code.c2 = 5;
@ -391,7 +391,7 @@ void FGApproach::calc_wp( const int &i ) {
double d1 = active_rw_hdg+180.0;
if ( d1 > 360.0 ) d1 -=360.0;
calc_cd_head_dist(360.0-course*SGD_RADIANS_TO_DEGREES, d/SG_NM_TO_METER,
d1, active_rw_len/SG_NM_TO_METER/2.,
d1, active_rw_len/SG_NM_TO_METER/2.0,
&planes[i].wpts[wpn][0], &planes[i].wpts[wpn][1]);
planes[i].wpts[wpn][2] = elev;
planes[i].wpts[wpn][4] = 0.0;
@ -402,8 +402,7 @@ void FGApproach::calc_wp( const int &i ) {
// horizontal navigation
// ======================
// waypoint 1: point for turning onto final
calc_cd_head_dist(planes[i].wpts[wpn-1][0], planes[i].wpts[wpn-1][1] ,
d1, lfl,
calc_cd_head_dist(planes[i].wpts[wpn-1][0], planes[i].wpts[wpn-1][1], d1, lfl,
&planes[i].wpts[wpn][0], &planes[i].wpts[wpn][1]);
calc_hd_course_dist(planes[i].wpts[wpn][0], planes[i].wpts[wpn][1],
planes[i].wpts[wpn-1][0], planes[i].wpts[wpn-1][1],
@ -413,9 +412,8 @@ void FGApproach::calc_wp( const int &i ) {
wpn += 1;
// calculate course and distance from plane position to waypoint 1
calc_hd_course_dist(planes[i].brg, planes[i].dist,
planes[i].wpts[1][0], planes[i].wpts[1][1],
&course, &d);
calc_hd_course_dist(planes[i].brg, planes[i].dist, planes[i].wpts[1][0],
planes[i].wpts[1][1], &course, &d);
// check if airport is not between plane and waypoint 1 and
// DCA to airport on course to waypoint 1 is larger than 10 miles
double zero = 0.0;
@ -438,9 +436,8 @@ void FGApproach::calc_wp( const int &i ) {
planes[i].wpts[wpn][5] = d;
wpn += 1;
calc_hd_course_dist(planes[i].brg, planes[i].dist,
planes[i].wpts[wpn-1][0], planes[i].wpts[wpn-1][1],
&course, &d);
calc_hd_course_dist(planes[i].brg, planes[i].dist, planes[i].wpts[wpn-1][0],
planes[i].wpts[wpn-1][1], &course, &d);
}
} else {
double leg = 10.0;
@ -699,7 +696,7 @@ void FGApproach::calc_cd_head_dist(const double &h1, const double &d1,
*d2 = sqrt((x1+x2)*(x1+x2) + (y1+y2)*(y1+y2));
*h2 = atan2( (y1+y2), (x1+x2) ) * SGD_RADIANS_TO_DEGREES;
if ( *h2 < 0 ) *h2 = *h2+360;
}
}