I want to make a distorted square shape in 2D data set from a rectangular function.
Here is my code to draw a square shape(Field length : 10, Square length: 5, Data num : 101).
x1 = ArrayReshape[Transpose[Tuples[Range[-(10/2), 10/2, .1], 2]][[1]], {101, 101}]; y1 = ArrayReshape[Transpose[Tuples[Range[-(10/2), 10/2, .1], 2]][[2]], {101, 101}]; rect[A_] := (UnitStep[x1 + A/2] - UnitStep[x1 - A/2]) (UnitStep[y1 + A/2] - UnitStep[y1 - A/2]); ArrayPlot[rect[5], ColorFunction -> "BlueGreenYellow"] Thanks in advance.




ImageTransformation. $\endgroup$