Hi,
I'm wondering if there are any template trigonometry functions in C++.
I used the following code for that purpose. But if the library has it,
it will be better.
Thanks,
Peng
#include <cmath>
template <typename T>
struct arctan2;
template <>
struct arctan2<double{
static double doit(double y, double x) { return atan2(y, x); }
};
template <>
struct arctan2<float{
static float doit(float y, float x) { return atan2f(y, x); }
};
template <>
struct arctan2<double{
static long double doit(long double y, long double x) { return
atan2l(y, x); }
};
Thanks,
Peng