diff --git a/src/render.c b/src/render.c index de0d798..663798d 100644 --- a/src/render.c +++ b/src/render.c @@ -26,7 +26,7 @@ double integrand_r(double *xy, size_t dim, void *integrand_params_void) { double rgb[3] = {0}; double theta_phi[2] = {theta, phi}; integrand_params->system->angle_to_pixel(theta_phi, rgb); - return rgb[0]*gsl_spline_eval_deriv(integrand_params->spline_data->spline, cotpsi, integrand_params->spline_data->acc); + return rgb[0]*fabs(gsl_spline_eval_deriv(integrand_params->spline_data->spline, cotpsi, integrand_params->spline_data->acc)); } double integrand_g(double *xy, size_t dim, void *integrand_params_void) { @@ -38,7 +38,7 @@ double integrand_g(double *xy, size_t dim, void *integrand_params_void) { double rgb[3] = {0}; double theta_phi[2] = {theta, phi}; integrand_params->system->angle_to_pixel(theta_phi, rgb); - return rgb[1]*gsl_spline_eval_deriv(integrand_params->spline_data->spline, cotpsi, integrand_params->spline_data->acc); + return rgb[1]*fabs(gsl_spline_eval_deriv(integrand_params->spline_data->spline, cotpsi, integrand_params->spline_data->acc)); } double integrand_b(double *xy, size_t dim, void *integrand_params_void) { @@ -50,7 +50,7 @@ double integrand_b(double *xy, size_t dim, void *integrand_params_void) { double rgb[3] = {0}; double theta_phi[2] = {theta, phi}; integrand_params->system->angle_to_pixel(theta_phi, rgb); - return rgb[2]*gsl_spline_eval_deriv(integrand_params->spline_data->spline, cotpsi, integrand_params->spline_data->acc); + return rgb[2]*fabs(gsl_spline_eval_deriv(integrand_params->spline_data->spline, cotpsi, integrand_params->spline_data->acc)); } int MC_pixel_render(const System *system, int i, int j, const Spline_data spline_data, double *rgb, int pixel_render_max, double pixel_render_err, gsl_rng *r){