예제 #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;
}
예제 #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;
}