// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2015 Daniele Panozzo // // This Source Code Form is subject to the terms of the Mozilla Public License // v. 2.0. If a copy of the MPL was not distributed with this file, You can // obtain one at http://mozilla.org/MPL/2.0/. #include "angles.h" #include #include template < typename DerivedV, typename DerivedF, typename Derivedtheta> void igl::angles( const Eigen::PlainObjectBase& V, const Eigen::PlainObjectBase& F, Eigen::PlainObjectBase& theta) { theta.resize(F.rows(),F.cols()); auto corner = [](const Eigen::PlainObjectBase& x, const Eigen::PlainObjectBase& y, const Eigen::PlainObjectBase& z) { Eigen::RowVector3d v1 = (x-y).normalized(); Eigen::RowVector3d v2 = (z-y).normalized(); // http://stackoverflow.com/questions/10133957/signed-angle-between-two-vectors-without-a-reference-plane double s = v1.cross(v2).norm(); double c = v1.dot(v2); return atan2(s, c); }; for(unsigned i=0; i, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); #endif