13 #include <boost/graph/graph_traits.hpp>
14 #include <boost/graph/properties.hpp>
35 template<
typename GeometryTraits >
40 const GeometryTraits &)
44 return Point((a[0] + b[0] + c[0]) / 3,
45 (a[1] + b[1] + c[1]) / 3,
46 (a[2] + b[2] + c[2]) / 3);
58 template<
typename GeometryTraits >
63 const GeometryTraits >)
67 Vector ab(b - a), bc(c - b), ca(a - c);
69 return (gt.length(ab) + gt.length(bc) + gt.length(ca));
81 template<
typename GeometryTraits >
86 const GeometryTraits >)
90 Vector cb(b[0] - c[0], b[1] - c[1], b[2] - c[2]),
91 ca(a[0] - c[0], a[1] - c[1], a[2] - c[2]);
92 return gt.cross_product(ca, cb);
104 template<
typename GeometryTraits >
109 const GeometryTraits >)
113 Vector n = triangle_normal_unnormalized< GeometryTraits >(a, b, c, gt);
114 return gt.length(n) * 0.5;
135 template<
typename FaceGraph,
143 const double prohib_energy,
144 const GeometryTraits >)
148 double d[3], circumradius, potential = prohib_energy, den;
150 Vector ab(b[0] - a[0], b[1] - a[1], b[2] - a[2]),
151 cb(b[0] - c[0], b[1] - c[1], b[2] - c[2]),
152 ca(a[0] - c[0], a[1] - c[1], a[2] - c[2]);
155 d[0] = gt.length(ab);
156 d[1] = gt.length(ca);
157 d[2] = gt.length(cb);
159 den = std::min< double >(d[2], std::min< double >(d[0], d[1]));
161 !FEVV::Math::Vector::are_collinear< GeometryTraits >(ab, ca))
163 circumradius = d[0] * d[1] * d[2] /
164 (4.0 * triangle_area< GeometryTraits >(a, b, c, gt));
165 potential = circumradius / den;
168 if(potential > prohib_energy)