src/AircraftTrajectories/Models/Trajectory/Trajectory.cs
/// <summary>
/// Calculates the bankangle on a given timestep t
/// </summary>
/// <param name="t"></param>
/// <returns></returns>
Calculates the bankangle on a given timestep t
Calculates the bankangle on a given timestep t
public double BankAngle(int t)
        {
            try {
                if (t < 5)
                {
                    return 0;
                }
                GeoPoint3D point1 = GeoPoint(t - 5);
                GeoPoint3D point2 = GeoPoint(t);
                GeoPoint3D point3 = GeoPoint(t + 5);
                double m_r = (point2.Longitude - point1.Longitude) / (point2.Latitude - point1.Latitude);
                double m_t = (point3.Longitude - point2.Longitude) / (point3.Latitude - point2.Latitude);
                double x_c = (m_r * m_t * (point3.Longitude - point1.Longitude) + m_r * (point2.Latitude + point3.Latitude) - m_t * (point1.Latitude + point2.Latitude)) / (2 * (m_r - m_t));
                double y_c = -(1 / m_r) * (x_c - ((point1.Latitude + point2.Latitude) / 2)) + ((point1.Longitude + point2.Longitude) / 2);
                if (double.IsInfinity(x_c))
                {
                    return 0;
                }
                GeoCoordinate c1 = new GeoCoordinate(point1.Latitude, point1.Longitude);
                GeoCoordinate centroid = new GeoCoordinate(x_c, y_c);
                double radius = c1.GetDistanceTo(centroid);
                double TAS = Speed(t);
                double g = 9.81;
                return Math.Atan(((TAS * TAS) / radius) / g) * (180 / Math.PI);
            } catch (Exception ex)
            {
                return 0;
            }
        }
public double BankAngle ( int t ) { try { if ( t < 5 ) { return 0 ; } GeoPoint3D point1 = GeoPoint ( t - 5 ) ; GeoPoint3D point2 = GeoPoint ( t ) ; GeoPoint3D point3 = GeoPoint ( t + 5 ) ; double m_r = ( point2 . Longitude - point1 . Longitude ) / ( point2 . Latitude - point1 . Latitude ) ; double m_t = ( point3 . Longitude - point2 . Longitude ) / ( point3 . Latitude - point2 . Latitude ) ; double x_c = ( m_r * m_t * ( point3 . Longitude - point1 . Longitude ) + m_r * ( point2 . Latitude + point3 . Latitude ) - m_t * ( point1 . Latitude + point2 . Latitude ) ) / ( 2 * ( m_r - m_t ) ) ; double y_c = - ( 1 / m_r ) * ( x_c - ( ( point1 . Latitude + point2 . Latitude ) / 2 ) ) + ( ( point1 . Longitude + point2 . Longitude ) / 2 ) ; if ( double . IsInfinity ( x_c ) ) { return 0 ; } GeoCoordinate c1 = new GeoCoordinate ( point1 . Latitude , point1 . Longitude ) ; GeoCoordinate centroid = new GeoCoordinate ( x_c , y_c ) ; double radius = c1 . GetDistanceTo ( centroid ) ; double TAS = Speed ( t ) ; double g = 9.81 ; return Math . Atan ( ( ( TAS * TAS ) / radius ) / g ) * ( 180 / Math . PI ) ; } catch ( Exception ex ) { return 0 ; } }
Calculates the bankangle on a given timestep t
Calculates the bankangle on a given timestep t
//source: http://www.regentsprep.org/regents/math/geometry/gcg6/RCir.htm
None
t
int
None