Блог пользователя Usu

Автор Usu, история, 6 лет назад, По-английски

Hey guys! I need your help. Lately I tried to make a program which check if a point is inside o polygon, I did it in N^2 for convex, I didn't find a brute force for concave. So if you can help me, I would be grateful for an implementation or a link for concave (brute force) and an implementation for faster running time, I know the idea behind it, but my implementation have some bugs and I want to see a corect one. That from geeksforgeeks is not correct if you think about it. Thanks in advance!

  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится

»
6 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

If you have a ray from the inside point in the polygon to any side it will cross the polygon odd number of times, and if it is in the outside it will cross it even number of times.

»
6 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится