2 #ifndef GEODESIC_CONSTANTS_20071231 3 #define GEODESIC_CONSTANTS_20071231 15 #define M_PI 3.14159265358979323846 19 double const GEODESIC_INF = 1e100;
23 double const SMALLEST_INTERVAL_RATIO = 1e-6;
27 inline double cos_from_edges(
double const a,
35 double result = (b*b + c*c - a*a)/(2.0*b*c);
36 result = std::max(result, -1.0);
37 return std::min(result, 1.0);
40 inline double angle_from_edges(
double const a,
44 return acos(cos_from_edges(a,b,c));
47 template<
class Po
ints,
class Faces>
48 inline bool read_mesh_from_file(
char* filename,
52 std::ifstream file(filename);
53 assert(file.is_open());
54 if(!file.is_open())
return false;
58 assert(num_points>=3);
63 points.resize(num_points*3);
64 for(
typename Points::iterator i=points.begin(); i!=points.end(); ++i)
69 faces.resize(num_faces*3);
70 for(
typename Faces::iterator i=faces.begin(); i!=faces.end(); ++i)
81 #endif //GEODESIC_CONSTANTS_20071231
Definition: geodesic_cpp_03_02_2008/geodesic_algorithm_base.h:11