From c0ba14ad391db55f3c772d4950a898cdf09598a4 Mon Sep 17 00:00:00 2001 From: tlatorre Date: Sun, 9 May 2021 11:32:29 -0700 Subject: fix sign in rayleigh scattering code This fix was found by Ako Jamil. Thanks! --- chroma/cuda/photon.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chroma/cuda/photon.h b/chroma/cuda/photon.h index 7c5c788..c2d99c5 100644 --- a/chroma/cuda/photon.h +++ b/chroma/cuda/photon.h @@ -156,7 +156,7 @@ pick_new_direction(float3 axis, float theta, float phi) float dirx = cos_theta*axis.x + sin_theta*(axis.z*cos_phi*cos_axis_phi - sin_phi*sin_axis_phi); float diry = cos_theta*axis.y + - sin_theta*(cos_phi*axis.z*sin_axis_phi - sin_phi*cos_axis_phi); + sin_theta*(cos_phi*axis.z*sin_axis_phi + sin_phi*cos_axis_phi); float dirz = cos_theta*axis.z - sin_theta*cos_phi*sin_axis_theta; return make_float3(dirx, diry, dirz); -- cgit