Infinite Circles

77 Views Asked by At

Trying to solve for t: $$\left(o_x+v_x\cdot t - \left\lfloor \frac{o_x+v_x\cdot t}{d}+\frac12\right\rfloor\cdot d\right)^2+\left(o_y+v_y\cdot t - \left\lfloor \frac{o_y+v_y\cdot t}{d}+\frac12\right\rfloor\cdot d\right)^2=r^2$$ This will allow me to see when a line intersects any circle that has a radius of r and is separated by distance d. o is the origin of the line, and v is its direction

You might still not know what this is doing, allow me to explain. Imagin you were on a sheet of grid paper, inside each grid there is a circle, and no matter where you are on this sheet you would be in a grid, depending on what grid you are in you could find the circle that is closest to you (being the circle in the grid you are in)