Rause code for the conversion for ra and dec

* float -> double

* Add error handling
This commit is contained in:
Malin Ejdbo
2021-06-16 10:56:46 +02:00
parent c8d7d5c294
commit 660ff65baf
4 changed files with 184 additions and 42 deletions
@@ -38,15 +38,16 @@ namespace openspace {
* \return A position in galactic cartesian coordinates, given in the same unit as the
* distance parameter.
*/
glm::dvec3 icrsToGalacticCartesian(float ra, float dec, double distance);
glm::dvec3 icrsToGalacticCartesian(double ra, double dec, double distance);
/**
* Converts from ICRS (hms and dms) coordinates to decimal degrees.
* \param ra Right ascension, given as a string in format "XXhYYmZZs"
* \param dec Declination, given as a string in format "+XXdYYmZZs" or "-XXdYYmZZs"
* \param dec Declination, given as a string in format "XXdYYmZZs", "-XXdYYmZZs",
* "XdYmZs" or "-XdYmZs"
* \return The decimal degrees coordinate
*/
glm::dvec2 icrsToDecimalDegrees(std::string ra, std::string dec);
glm::dvec2 icrsToDecimalDegrees(const std::string& ra, const std::string& dec);
} // namespace openspace