commit 484d84596ef059463d905f07c65672b92a38a28c
Author: Mattias Andrée <maandree_AT_kth.se>
AuthorDate: Tue Jul 11 19:18:56 2017 +0200
Commit: Mattias Andrée <maandree_AT_kth.se>
CommitDate: Tue Jul 11 19:18:56 2017 +0200
blind-spiral-gradient: set the value of the singularity to 0
Signed-off-by: Mattias Andrée <maandree_AT_kth.se>
diff --git a/src/blind-spiral-gradient.c b/src/blind-spiral-gradient.c
index a248a02..8bdda44 100644
--- a/src/blind-spiral-gradient.c
+++ b/src/blind-spiral-gradient.c
_AT_@ -66,12 +66,16 @@ static int with_vector;
y = (TYPE)iy - y1;\
for (ix = 0; ix < width; ix++) {\
x = (TYPE)ix - x1;\
- v = atan2(y, x);\
- if (anticlockwise)\
- v = 1 - v;\
- v -= u;\
- v += 4 * (TYPE)M_PI;\
- v = mod(v, 2 * (TYPE)M_PI);\
+ if (!x && !y) {\
+ v = 0;\
+ } else {\
+ v = atan2(y, x);\
+ if (anticlockwise)\
+ v = 1 - v;\
+ v -= u;\
+ v += 4 * (TYPE)M_PI;\
+ v = mod(v, 2 * (TYPE)M_PI);\
+ }\
if (!with_vector) {\
r = sqrt(x * x + y * y);\
} else {\
Received on Tue Jul 11 2017 - 21:41:11 CEST
This archive was generated by hypermail 2.3.0
: Tue Jul 11 2017 - 21:49:10 CEST