Code

fix error in curve cxxtests
[inkscape.git] / src / 2geom / coord.h
index 34a585bf9fe43ac44a799b59b32ce7c974777c66..b44a0f71e9705cc2a00d9ae3d24fc5a5ae26d62e 100644 (file)
@@ -1,5 +1,6 @@
-/*
- * coord.h
+/**
+ *  \file
+ *  \brief Defines the Coord "real" type with sufficient precision for coordinates.
  *
  * Copyright 2006 Nathan Hurst <njh@mail.csse.monash.edu.au>
  *
@@ -32,6 +33,7 @@
 #define SEEN_Geom_COORD_H
 
 #include <cmath>
+#include <limits>
 
 namespace Geom {
 
@@ -46,19 +48,10 @@ typedef double Coord;
 
 const Coord EPSILON = 1e-5; //1e-18;
 
-
-#ifdef near
-#define lib2geom_near_save near
-#undef near
-#endif
+inline Coord infinity() {  return std::numeric_limits<Coord>::infinity();  }
 
 //IMPL: NearConcept
-inline bool near(Coord a, Coord b, double eps=EPSILON) { return fabs(a-b) <= eps; }
-
-#ifdef lib2geom_near_save
-#define near lib2geom_near_save
-#undef lib2geom_near_save
-#endif
+inline bool are_near(Coord a, Coord b, double eps=EPSILON) { return fabs(a-b) <= eps; }
 
 } /* namespace Geom */