💿🐜 Antkeeper source code https://antkeeper.com
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.

66 lines
2.0 KiB

  1. /*
  2. * Copyright (C) 2020 Christopher J. Howard
  3. *
  4. * This file is part of Antkeeper source code.
  5. *
  6. * Antkeeper source code is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * Antkeeper source code is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with Antkeeper source code. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef ANTKEEPER_CELESTIAL_TIME_HPP
  20. #define ANTKEEPER_CELESTIAL_TIME_HPP
  21. namespace ast
  22. {
  23. /**
  24. * Calculates the Julian date from a universal time.
  25. *
  26. * @param year Gregorian year, with 1 BC as 0.
  27. * @param month Gregorian month, on [1, 12].
  28. * @param day Gregorian day, on [1, 31].
  29. * @param hour Hour, on [0, 23].
  30. * @param minute Minute, on [0, 59].
  31. * @param second Second on [0, 60).
  32. * @return Julian date with fractional day.
  33. */
  34. double ut_to_jd(int year, int month, int day, int hour, int minute, double second);
  35. /**
  36. * Calculates the Greenwich mean sidereal time (GMST) from a Julian date.
  37. *
  38. * @param jd Julian date.
  39. * @return GMST, in radians.
  40. */
  41. double jd_to_gmst(double jd);
  42. /**
  43. * Calculates local mean sidereal time (LMST) from a Julian date.
  44. *
  45. * @param jd Julian date.
  46. * @param longitude Longitude of the observer, in radians.
  47. */
  48. double jd_to_lmst(double jd, double longitude);
  49. /**
  50. * Calculates local mean sidereal time (LMST) from Greenwich mean sidereal time (GMST).
  51. *
  52. * @param gmst Greenwich mean sidereal time, in radians.
  53. * @param longitude Longitude of the observer, in radians.
  54. * @return Local mean sidereal time, in radians.
  55. */
  56. double gmst_to_lmst(double gmst, double longitude);
  57. } // namespace ast
  58. #endif // ANTKEEPER_CELESTIAL_TIME_HPP