You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

grtcirc.h 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. Great Circle utility functions
  3. Copyright (C) 2002-2014 Robert Lipe, robertlipe+source@gpsbabel.org
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
  15. */
  16. #ifndef GRTCIRC_H
  17. #define GRTCIRC_H
  18. double gcdist(double lat1, double lon1, double lat2, double lon2);
  19. double heading(double lat1, double lon1, double lat2, double lon2);
  20. double heading_true_degrees(double lat1, double lon1, double lat2, double lon2);
  21. double linedistprj(double lat1, double lon1,
  22. double lat2, double lon2,
  23. double lat3, double lon3,
  24. double* prjlat, double* prjlon,
  25. double* frac);
  26. double linedist(double lat1, double lon1,
  27. double lat2, double lon2,
  28. double lat3, double lon3);
  29. double radtometers(double rads);
  30. double radtomiles(double rads);
  31. void linepart(double lat1, double lon1,
  32. double lat2, double lon2,
  33. double frac,
  34. double* reslat, double* reslon);
  35. /* Degrees to radians */
  36. #define DEG(x) ((x)*180.0/M_PI)
  37. /* Radians to degrees */
  38. #define RAD(x) ((x)*M_PI/180.0)
  39. #endif