]> git.mxchange.org Git - flightgear.git/blob - src/ATC/ATCProjection.hxx
Preliminary support for AI planes from Dave Luff. This works only at
[flightgear.git] / src / ATC / ATCProjection.hxx
1 #ifndef _FG_ATC_PROJECTION_HXX
2 #define _FG_ATC_PROJECTION_HXX
3
4 #include <simgear/math/point3d.hxx>
5
6 // FGATCProjection - a class to project an area local to an airport onto an orthogonal co-ordinate system
7 class FGATCProjection {
8
9 public:
10     FGATCProjection();
11     ~FGATCProjection();
12
13     void Init(Point3D centre);
14
15     // Convert a lat/lon co-ordinate to the local projection
16     Point3D ConvertToLocal(Point3D pt);
17
18     // Convert a local projection co-ordinate to lat/lon
19     Point3D ConvertFromLocal(Point3D pt);
20
21 private:
22     Point3D origin;     // lat/lon of local area origin
23     double correction_factor;   // Reduction in surface distance per degree of longitude due to latitude.  Saves having to do a cos() every call.
24
25 };
26
27
28 // FGATCAlignedProjection - a class to project an area local to a runway onto an orthogonal co-ordinate system
29 // with the origin at the threshold and the runway aligned with the y axis.
30 class FGATCAlignedProjection {
31
32 public:
33     FGATCAlignedProjection();
34     ~FGATCAlignedProjection();
35
36     void Init(Point3D centre, double heading);
37
38     // Convert a lat/lon co-ordinate to the local projection
39     Point3D ConvertToLocal(Point3D pt);
40
41     // Convert a local projection co-ordinate to lat/lon
42     Point3D ConvertFromLocal(Point3D pt);
43
44 private:
45     Point3D origin;     // lat/lon of local area origin (the threshold)
46     double theta;       // the rotation angle for alignment in radians
47     double correction_factor;   // Reduction in surface distance per degree of longitude due to latitude.  Saves having to do a cos() every call.
48
49 };
50
51 #endif  // _FG_ATC_PROJECTION_HXX