From f28f809867729bf4fe761e1c887b5e807304cc2f Mon Sep 17 00:00:00 2001 From: Mickael Savinaud <mickael.savinaud@c-s.fr> Date: Tue, 13 May 2014 10:10:35 +0200 Subject: [PATCH] ENH: move the new function to compute earth-sun distance to OTB style and OTB multiplatform function --- Code/Radiometry/otbVarSol.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Code/Radiometry/otbVarSol.h b/Code/Radiometry/otbVarSol.h index 6f772884c6..37e54e4546 100644 --- a/Code/Radiometry/otbVarSol.h +++ b/Code/Radiometry/otbVarSol.h @@ -49,21 +49,20 @@ namespace otb /* Local variables */ int j; - double pi, om; + double om; /* calculation of the variability of the solar constant during the year. */ /* day is the number of the day in the month */ if (month <= 2) - j = (month - 1) * 31 + day; + j = (month - 1) * 31 + day; else if (month > 8) - j = (month - 1) * 31 - (month - 2) / 2 - 2 + day; + j = (month - 1) * 31 - (month - 2) / 2 - 2 + day; else - j = (month - 1) * 31 - (month - 1) / 2 - 2 + day; + j = (month - 1) * 31 - (month - 1) / 2 - 2 + day; - pi = acos(0.) * 2.; - om = (double) (j - 4) * .9856 * pi / 180.; + om = (double) (j - 4) * .9856 * CONST_PI_180; /* Computing 2nd power */ - d__1 = 1. - cos(om) * .01673; + d__1 = 1. - vcl_cos(om) * .01673; return 1. / (d__1 * d__1); } }; -- GitLab