Consider the matrix 'm1' :
m1 = RandomReal[{0, 1}, {100, 100}];
Let's pick one of the elements of this matrix. It will be the center (point of intersection of the diagonals) of the rectangle with sides (a, b) and the slope angle of the side 'b' alpha (0, 90 degrees):
For a -> 20, b -> 10, m -> 50, n -> 30, [Alpha] -> Pi/6:
The length of the side of the rectangle is the number (0, Dimensions [m1] [[1]]
).
The question is what elements of the matrix 'm1' are in the area of this rectangle, setting the result in the form of a matrix of numbers (rows and columns). If there are not all elements of columns or rows, the element in the matrix will be empty.
We do not include rectangles that are outside the matrix 'm1':
For a -> 20, b -> 10, m -> 50, n -> 30, \[Alpha] -> Pi/6
,where gray dots are blank spaces in the matrix. By the way. Why are the corners not completely filled with red dots? Does it just seem so? In addition, the code takes into account incomplete rectangles, e.g. a -> 20, b -> 10, m -> 10, n -> 3, \ [Alpha] -> Pi / 6. Maybe such a limitation can be done by counting the area of a rectangle?