// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2019 Hanxiao Shen // // 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 "point_inside_convex_polygon.h" template IGL_INLINE bool igl::predicates::point_inside_convex_polygon( const Eigen::MatrixBase& P, const Eigen::MatrixBase& q ){ EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(DerivedP, Eigen::Dynamic, 2); EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(DerivedQ, 1, 2); typedef typename DerivedP::Scalar Scalar; for(int i=0;i a = P.row(i); Eigen::Matrix b = P.row(i_1); auto r = igl::predicates::orient2d(a,b,q); if(r == igl::predicates::Orientation::COLLINEAR || r == igl::predicates::Orientation::NEGATIVE) return false; } return true; } #ifdef IGL_STATIC_LIBRARY template bool igl::predicates::point_inside_convex_polygon, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); #endif