8#ifndef model_Polygon2D_H_
9#define model_Polygon2D_H_
24 template<
typename Po
intType>
25 static double area(
const std::vector<PointType>& points)
28 for(
size_t k=0;
k<points.size();++
k)
30 const size_t k1(
k<points.size()-1?
k+1 : 0);
31 A+=(points[
k](0)-points[0](0))*(points[k1](1)-points[
k](1))-(points[
k](1)-points[0](1))*(points[k1](0)-points[
k](0));
48 template<
typename Po
intType>
49 static double isLeft(
const PointType& P0,
const PointType& P1,
const PointType& P2 )
51 return ( (P1(0) - P0(0)) * (P2(1) - P0(1))
52 - (P2(0) - P0(0)) * (P1(1) - P0(1)) );
55 template<
typename Po
intType>
56 static int windingNumber(
const PointType& P,
const std::vector<PointType>&
V)
61 for (
size_t i=0;
i<
V.size();
i++) {
62 const size_t j(
i<
V.size()-1?
i+1 : 0);
63 if (
V[
i](1) <= P(1)) {
function infiniteDisplacement syms Ax Ay Az Bx By Bz qx qy qz u L x y z real A
static int windingNumber(const PointType &P, const std::vector< PointType > &V)
static double isLeft(const PointType &P0, const PointType &P1, const PointType &P2)
static double area(const std::vector< PointType > &points)