solstice-solver

Solver library of the solstice app
git clone git://git.meso-star.com/solstice-solver.git
Log | Files | Refs | README | LICENSE

commit 214403f413875775f5b346d568ba96a34b3ea9fd
parent 3371d0d2a21fd6880e146faa3d094372e9957838
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date:   Fri,  8 Dec 2017 16:06:25 +0100

Fix wrong max value for sun pillbox half angle.

Diffstat:
Msrc/ssol.h | 2+-
Msrc/ssol_sun.c | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/ssol.h b/src/ssol.h @@ -1042,7 +1042,7 @@ ssol_sun_set_spectrum SSOL_API res_T ssol_sun_pillbox_set_half_angle (struct ssol_sun* sun, - const double half_angle); /* In radian */ + const double half_angle); /* In ]0, PI/2], in radian */ SSOL_API res_T ssol_sun_set_buie_param diff --git a/src/ssol_sun.c b/src/ssol_sun.c @@ -172,7 +172,7 @@ ssol_sun_set_spectrum(struct ssol_sun* sun, struct ssol_spectrum* spectrum) res_T ssol_sun_pillbox_set_half_angle(struct ssol_sun* sun, const double half_angle) { - if(!sun || half_angle <= 0 || half_angle > PI || sun->type != SUN_PILLBOX) + if(!sun || half_angle <= 0 || half_angle > PI * 0.5 || sun->type != SUN_PILLBOX) return RES_BAD_ARG; sun->data.pillbox.half_angle = half_angle; return RES_OK;