Count points in a rectangle

前端 未结 9 1493
失恋的感觉
失恋的感觉 2020-12-29 23:53

I have lots (billions) of points in 2D which I can preprocess and I would like to answer queries which are of the following form:

Given all four corners of a rectang

9条回答
  •  误落风尘
    2020-12-30 00:36

    You can use a BoundBox for the rectangle then if a point is inside the boundbox you can check if it collide with the rectangle or you can use oriented bounded box.

    This is the simplest way and don't need use of complex data structure

提交回复
热议问题