python - The intersection between a trajectory and the circles in the same area -


i new in coding. have question. have object keep moving in rectangle area. , have lot of circle in area too. want intersection point between trajectory , circle. object moving step step, thinking can calculate distance between position of object , centre of each circle , compare distance radius of circle. think lot of computation need calculate distance @ each step. have idea or reference. way, woking on python. thank you. not have enough reputation , can not add picture problem

let a number somewhere between radius , diameter of larger circles (if have different radii).

generate grid of square tiles of side length a, grid(i,k) square (i*a,k*a) ((i+1)*a, (k+1)*a).

each tile of grid contains list pointers circles or indices circle array.

for each circle, register each tile intersects with. should less 4.


now test point (x,y) of trajectory circle intersections resp. containment inside corresponding disk, need test against list of circles in tile ((int)(x/a), (int)(y/a).


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -