Esempio n. 1
0
number area2(const G& P) {
  number A = 0;
  for (int i = 0; i < P.size(); ++i) 
    A += cross(curr(P, i), next(P, i));
  return A;
}
Esempio n. 2
0
/*
 polygon area * 2
 */
double area2(const G& P) {
    double A = 0;
    for (int i = 0; i < P.size(); ++i)
        A += cross(curr(P, i), next(P, i));
    return A;
}