]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/ATCutils.hxx
Mathias Fröhlich:
[flightgear.git] / src / ATC / ATCutils.hxx
index d009c888733a288c89bdfe04036d74e7d9a15d15..448099a672680686c55920845eb10aba06209594 100644 (file)
@@ -19,6 +19,7 @@
 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
 #include <Airports/simple.hxx>
+#include <Airports/runways.hxx>
 
 #include <math.h>
 #include <simgear/math/point3d.hxx>
@@ -39,6 +40,9 @@ SG_USING_STD(string);
 // Convert any number to spoken digits
 string ConvertNumToSpokenDigits(string n);
 
+// Convert an integer to spoken digits
+string ConvertNumToSpokenDigits(int n);
+
 // Convert a 2 digit rwy number to a spoken-style string
 string ConvertRwyNumToSpokenString(int n);
 
@@ -52,6 +56,14 @@ string ConvertRwyNumToSpokenString(string s);
 // Return the phonetic letter of a letter represented as an integer 1->26
 string GetPhoneticIdent(int i);
 
+// Return the phonetic letter of a character in the range a-z or A-Z.
+// Currently always returns prefixed by lowercase.
+string GetPhoneticIdent(char c);
+
+// Get the compass direction associated with a heading in degrees
+// Currently returns 8 direction resolution (N, NE, E etc...)
+// Might be modified in future to return 4, 8 or 16 resolution but defaulting to 8. 
+string GetCompassDirection(double h);
 
 /*******************************
 *
@@ -76,6 +88,10 @@ double GetHeadingFromTo(Point3D A, Point3D B);
 // Given a heading (in degrees), bound it from 0 -> 360
 void dclBoundHeading(double &hdg);
 
+// smallest difference between two angles in degrees
+// difference is negative if a1 > a2 and positive if a2 > a1
+double GetAngleDiff_deg( const double &a1, const double &a2);
+
 
 /*******************************
 *
@@ -89,5 +105,18 @@ void dclBoundHeading(double &hdg);
 // find basic airport location info from airport database
 bool dclFindAirportID( const string& id, FGAirport *a );
 
-// get airport elevation
+// get airport elevation IN METERS
 double dclGetAirportElev( const string& id );
+
+// get airport position (elev portion in FEET)
+Point3D dclGetAirportPos( const string& id );
+
+/****************
+*
+*   Runways
+*
+****************/
+
+// Given a Point3D (lon/lat/elev) and an FGRunway struct, determine if the point lies on the runway
+bool OnRunway(Point3D pt, const FGRunway& rwy);
+