From 9646e43e6016536911f0703dc7e3af7a0eae56db Mon Sep 17 00:00:00 2001 From: tlatorre Date: Wed, 4 Jul 2018 12:22:21 -0400 Subject: add a test of the get_solid_angle function --- solid_angle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'solid_angle.c') diff --git a/solid_angle.c b/solid_angle.c index 5fc6033..cbc71f1 100644 --- a/solid_angle.c +++ b/solid_angle.c @@ -15,7 +15,7 @@ double get_solid_angle(double *pos, double *pmt, double *n, double r) dir[1] = pos[1] - pmt[1]; dir[2] = pos[2] - pmt[2]; - L = dir[0]*n[0] + dir[1]*n[1] + dir[2]*n[2]; + L = fabs(dir[0]*n[0] + dir[1]*n[1] + dir[2]*n[2]); R = sqrt(dir[0]*dir[0] + dir[1]*dir[1] + dir[2]*dir[2]); r0 = sqrt(R*R - L*L); -- cgit