I'm working on a simple visibility algorithm, I want to check if some point can be seen by some other point (there are obstacles).
So let's say I have a 2d array [][] and 2 points: Point A ([A1][A2]) and point B ([B1][B2]).
I create a vector between the center of those two points V=(A,B) and now I need to check which boxes of the grid are crossed by the vector V.
If some of those boxes are indeed an obstacle then I can say that point B can't be seen from point A.
Is there a way to check which positions of the 2d array are crossed by the (imaginary) drawn vector?