aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2015-01-30 13:18:24 +0100
committerAnton Khirnov <anton@khirnov.net>2015-01-30 13:18:24 +0100
commit307d35ed2bc4e073ae3a6ceac3dcb7a74f25e98a (patch)
tree444bd65f2c743e841d2e23f0ec443d46b0491579
parentc412ac65afca2b84b4a3a5fc94a24c8359a2c2e9 (diff)
Use atan2 instead of special handling of 0.
-rw-r--r--brill_data.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/brill_data.c b/brill_data.c
index b1e2230..9c98ec4 100644
--- a/brill_data.c
+++ b/brill_data.c
@@ -88,7 +88,7 @@ typedef struct BDPriv {
static long double sb_even_eval(long double coord, int idx, long double sf)
{
- long double val = (coord == 0.0) ? M_PI_2 : atanl(sf / fabsl(coord));
+ long double val = atan2l(sf, coord);
idx *= 2; // even only
@@ -97,7 +97,7 @@ static long double sb_even_eval(long double coord, int idx, long double sf)
static long double sb_even_eval_diff1(long double coord, int idx, long double sf)
{
- long double val = (coord == 0.0) ? M_PI_2 : atanl(sf / fabsl(coord));
+ long double val = atan2l(sf, coord);
idx *= 2; // even only
@@ -106,7 +106,7 @@ static long double sb_even_eval_diff1(long double coord, int idx, long double sf
static long double sb_even_eval_diff2(long double coord, int idx, long double sf)
{
- long double val = (coord == 0.0) ? M_PI_2 : atanl(sf / fabsl(coord));
+ long double val = atan2l(sf, coord);
idx *= 2; // even only