Special polygonial for loop in two dimensional array
问题 This is a bit tricky question for you computer scientists. Let's say that I have a two dimensional array/matrix of 100 by 100 entries, arr[i][j]. Where i and j goes from 0-99. This can be envisioned as a square of dots with each dot corresponding to a data value. Now, If I define a 4 point polygon and know the indicies of the 4 points: Is it possible (is there an clever algorithm) to loop through only those entries in the matrix that lies inside of the 4-point polygon? That is, every value of