#pragma once

#include <cmath>

namespace autoopt {

template <typename T>
T rad2deg(T radians) {
  return radians * (T{180} / M_PI);
}

template <typename T>
T deg2rad(T degrees) {
  return degrees * (M_PI / T{180}); 
}

template <typename T>
T rad2arcmin(T radians) {
  return radians * (T{180 * 60} / M_PI);
}

template <typename T>
T arcmin2rad(T arcminutes) {
  return arcminutes * (M_PI / T{180 * 60});
}

template <typename T>
T rad2arcsec(T radians) {
  return radians * (T{180 * 60 * 60} / M_PI);
}

template <typename T>
T arcsec2rad(T arcseconds) {
  return arcseconds * (M_PI / T{180 * 60 * 60});
}


}  // namespace autoopt
