2 #ifndef GEODESIC_CONSTANTS_20071231 3 #define GEODESIC_CONSTANTS_20071231 14 #define M_PI 3.14159265358979323846 18 double const GEODESIC_INF = 1e100;
22 double const SMALLEST_INTERVAL_RATIO = 1e-6;
26 inline double cos_from_edges(
double const a,
34 double result = (b*b + c*c - a*a)/(2.0*b*c);
35 result = std::max(result, -1.0);
36 return std::min(result, 1.0);
39 inline double angle_from_edges(
double const a,
43 return acos(cos_from_edges(a,b,c));
46 template<
class Po
ints,
class Faces>
47 inline bool read_mesh_from_file(
char* filename,
51 std::ifstream file(filename);
52 FEASSERT(file.is_open());
53 if(!file.is_open())
return false;
57 FEASSERT(num_points>=3);
62 points.resize(num_points*3);
63 for(
typename Points::iterator i=points.begin(); i!=points.end(); ++i)
68 faces.resize(num_faces*3);
69 for(
typename Faces::iterator i=faces.begin(); i!=faces.end(); ++i)
80 #endif //GEODESIC_CONSTANTS_20071231
Definition: geodesic_cpp_03_02_2008/geodesic_algorithm_base.h:11