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 i and j in the loop laps correspond to a value in arr[i][j] that is interesting (i and j is inside the 4-point poly).
这是否明确? 我理解,如果难以理解。
阁下