00001 00006 // Written by Curtis Olson, started June 1997. 00007 // 00008 // Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt 00009 // 00010 // This library is free software; you can redistribute it and/or 00011 // modify it under the terms of the GNU Library General Public 00012 // License as published by the Free Software Foundation; either 00013 // version 2 of the License, or (at your option) any later version. 00014 // 00015 // This library is distributed in the hope that it will be useful, 00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 // Library General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU General Public License 00021 // along with this program; if not, write to the Free Software 00022 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00023 // 00024 // $Id: polar3d_8hxx_source.html,v 1.3 2010/02/23 22:10:15 curt Exp $ 00025 00026 00027 #ifndef _POLAR3D_HXX 00028 #define _POLAR3D_HXX 00029 00030 00031 #ifndef __cplusplus 00032 # error This library requires C++ 00033 #endif 00034 00035 #include <simgear/math/point3d.hxx> 00036 #include "SGMath.hxx" 00037 00048 inline Point3D calc_gc_lon_lat(const Point3D& orig, double course, double dist) 00049 { return Point3D::fromSGGeoc(orig.toSGGeoc().advanceRadM(course, dist)); } 00050 00051 00059 inline void calc_gc_course_dist( const Point3D& start, const Point3D& dest, 00060 double *course, double *dist ) 00061 { 00062 SGGeoc gs = start.toSGGeoc(); 00063 SGGeoc gd = dest.toSGGeoc(); 00064 *course = SGGeoc::courseRad(gs, gd); 00065 *dist = SGGeoc::distanceM(gs, gd); 00066 } 00067 00068 #endif // _POLAR3D_HXX 00069