1 // ATCProjection.hxx - A convienience projection class for the ATC/AI system.
3 // Written by David Luff, started 2002.
5 // Copyright (C) 2002 David C Luff - david.luff@nottingham.ac.uk
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef _FG_ATC_PROJECTION_HXX
22 #define _FG_ATC_PROJECTION_HXX
24 #include <simgear/math/SGMath.hxx>
26 // FGATCAlignedProjection - a class to project an area local to a runway onto an orthogonal co-ordinate system
27 // with the origin at the threshold and the runway aligned with the y axis.
28 class FGATCAlignedProjection {
31 FGATCAlignedProjection();
32 FGATCAlignedProjection(const SGGeod& centre, double heading);
33 ~FGATCAlignedProjection();
35 void Init(const SGGeod& centre, double heading);
37 // Convert a lat/lon co-ordinate (degrees) to the local projection (meters)
38 SGVec3d ConvertToLocal(const SGGeod& pt);
40 // Convert a local projection co-ordinate (meters) to lat/lon (degrees)
41 SGGeod ConvertFromLocal(const SGVec3d& pt);
44 SGGeod _origin; // lat/lon of local area origin (the threshold)
45 double _theta; // the rotation angle for alignment in radians
46 double _correction_factor; // Reduction in surface distance per degree of longitude due to latitude. Saves having to do a cos() every call.
50 #endif // _FG_ATC_PROJECTION_HXX