// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2019 Qingnan Zhou // // 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/. #pragma once #ifndef IGL_PREDICATES_ORIENT2D_H #define IGL_PREDICATES_ORIENT2D_H #include "../igl_inline.h" #include #include "Orientation.h" namespace igl { namespace predicates { /// Compute the orientation of the triangle formed by pa, pb, pc. /// /// @param[in] pa 2D point on line /// @param[in] pb 2D point on line /// @param[in] pc 2D query point. /// @return POSITIVE if pa, pb, pc are counterclockwise oriented. /// NEGATIVE if they are clockwise oriented. /// COLLINEAR if they are collinear. /// /// \fileinfo template IGL_INLINE Orientation orient2d( const Eigen::MatrixBase& pa, const Eigen::MatrixBase& pb, const Eigen::MatrixBase& pc); /// Compute the orientation of the tetrahedron formed by each 4-tuple of /// points /// /// @param[in] A #P|1 by 3 matrix of 3D points /// @param[in] B #P|1 by 3 matrix of 3D points /// @param[in] C #P|1 by 3 matrix of 3D points /// @param[out] R #P vector of orientations /// template IGL_INLINE void orient2d( const Eigen::MatrixBase& A, const Eigen::MatrixBase& B, const Eigen::MatrixBase& C, Eigen::PlainObjectBase& R); } } #ifndef IGL_STATIC_LIBRARY #include "orient2d.cpp" #endif #endif