tags:

views:

65

answers:

0
 int i, j, c = 0;
 int num = ring.points_.size();

 for (i = 0, j = num-1; i < num; j = i++) {
        if ((((ring.points_[i].y_ <= pt.y_) && (pt.y_ < ring.points_[j].y_)) ||
   ((ring.points_[j].y_ <= pt.y_) && (pt.y_ < ring.points_[i].y_))) &&
            (pt.x_ < (ring.points_[j].x_ - ring.points_[i].x_) * (pt.y_ - ring.points_[i].y_) / (ring.points_[j].y_ - ring.points_[i].y_) + ring.points_[i].x_))
   c = !c;
 }
 return c;
}

i am not getting this loop with if..can you explain it..