1 #ifndef SRC_CLIMATH_CORE_H_
2 #define SRC_CLIMATH_CORE_H_
14 inline double sqr(
double x) {
return x * x; }
15 inline double cub(
double x) {
return x * x * x; }
16 inline double min(
double x1,
double x2,
double x3) {
17 return fmin(
x1, fmin(
x2, x3));
19 inline double max(
double x1,
double x2,
double x3) {
20 return fmax(
x1, fmax(
x2, x3));
24 for (
int i = 1; i < n; ++i)
25 if (v <
a[i]) v =
a[i];
30 for (
int i = 1; i < n; ++i)
31 if (v >
a[i]) v =
a[i];
34 inline int sign(
double x) {
return x < 0. ? -1 : 1; }
40 inline double rad2deg(
double phi) {
return phi * 180. / M_PI; }
41 inline double deg2rad(
double phi) {
return phi * M_PI / 180.; }
43 inline double km2m(
double x) {
return x * 1.E3; }
44 inline double m2km(
double x) {
return x / 1.E3; }
46 inline double day2sec(
double x) {
return x * 86400.; }
47 inline double sec2day(
double x) {
return x / 86400.; }
49 inline double au2m(
double x) {
return x * 1.495978707E11; }
50 inline double m2au(
double x) {
return x / 1.495978707E11; }
double deg2rad(double phi)
double min(double x1, double x2, double x3)
double max(double x1, double x2, double x3)
int fcmp(double x1, double x2)
double allmin(double *a, int n)
double allmax(double *a, int n)
double rad2deg(double phi)