#include "doublearea.h" #include "edge_lengths.h" #include template IGL_INLINE void igl::doublearea( const Eigen::PlainObjectBase & V, const Eigen::PlainObjectBase & F, Eigen::PlainObjectBase & dblA) { // Only support triangles assert(F.cols() == 3); // Compute edge lengths Eigen::PlainObjectBase l; edge_lengths(V,F,l); return doublearea(l,dblA); } template IGL_INLINE void igl::doublearea( const Eigen::PlainObjectBase & l, Eigen::PlainObjectBase & dblA) { // Only support triangles assert(l.cols() == 3); // Number of triangles const int m = l.rows(); // semiperimeters Eigen::PlainObjectBase s = l.rowwise().sum()*0.5; assert(s.rows() == m); // resize output dblA.resize(l.rows(),1); // Heron's formula for area for(int i = 0;i, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); template void igl::doublearea, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); template void igl::doublearea, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); #endif