From 8fc44f99cc58f95d24f26ad1ec82c09547764e7a Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 29 Jun 2015 18:01:45 -0500 Subject: [PATCH] Avoid computing atan(y/x) where x=0. Rather, use atan2(y,x). --- tests/codim_one/bem_integration.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/codim_one/bem_integration.cc b/tests/codim_one/bem_integration.cc index 063d2dd28b..9b03d82c94 100644 --- a/tests/codim_one/bem_integration.cc +++ b/tests/codim_one/bem_integration.cc @@ -165,7 +165,7 @@ LaplaceKernelIntegration::term_S (const Tensor<1,3> &r, *( - ra1*n/a1.norm() * asinh( r*a1/ra1.norm() ) + ra2*n/a2.norm() * asinh( r*a2/ra2.norm() ) - + rn_c * atan( ra1*ra2 / (r.norm()* (r*(a12)))) + + rn_c * atan2( ra1*ra2, r.norm()* (r*a12) ) ); return integral; @@ -185,7 +185,7 @@ LaplaceKernelIntegration::term_D (const Tensor<1,3> &r, cross_product(a12,a1,a2); double integral = 1./2./numbers::PI - *atan( ra1*ra2 / (r.norm()* (r*(a12)))); + *atan2( ra1*ra2, (r.norm()* (r*a12))); return integral; -- 2.39.5