summaryrefslogtreecommitdiffstatsci
path: root/src/vectors.c
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2019-11-22 11:43:18 +0100
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2019-11-22 11:43:18 +0100
commit8d3e4df8cf302fe668f332f3eb849ea4f64c6239 (patch)
tree61ad34a56b6c3856c6c64fb000ab2bd71111753f /src/vectors.c
parent20c1cbace2b9f92380531cd72d86b9dbbcdc7eda (diff)
add nan test in _build_vb_step to prevent stroke building for two consecutive points that are equalsnewvertex
Diffstat (limited to 'src/vectors.c')
-rw-r--r--src/vectors.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vectors.c b/src/vectors.c
index 686db85..b29180b 100644
--- a/src/vectors.c
+++ b/src/vectors.c
@@ -108,3 +108,11 @@ void vec2_inv (vec2* v){
v->x = -v->x;
v->y = -v->y;
}
+// test if one component of float vector is nan
+inline bool vec2_isnan (vec2 v){
+ return (bool)(isnanf (v.x) || isnanf (v.y));
+}
+// test if one component of double vector is nan
+inline bool vec2d_isnan (vec2d v){
+ return (bool)(isnan (v.x) || isnan (v.y));
+}