Finding all the points within a circle in 2D space

前端 未结 7 1797
自闭症患者
自闭症患者 2021-02-13 12:58

I am representing my 2D space (consider a window), where each pixel is shown as a cell in a 2D array. i.e. a 100x100 window is represented by the array of same dimensions.

7条回答
  •  -上瘾入骨i
    2021-02-13 13:41

    seems correct. you can make it slightly faster by finding minY and then doing DoSomething from -rangeY to +rangeY for the current X.

    for(dx=0;dx

提交回复
热议问题