修改为:

if (p.x != Sides[i].start.x && p.x != Sides[i].end.x) { //如果点不在边的端点上,计数器加1或减1 if (Sides[i].start.y > Sides[i].end.y) { count++; } else { count--; } }

int countIntersectionsPoint p Side Sides int n 计算交点个数 int count = 0; for int i = 0; i n; i++ if !isParallelSidesiendy - Sidesistarty Sidesiendx - Sidesistartx 如果边不平行x轴 if is

原文地址: https://www.cveoy.top/t/topic/fjyf 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录