## 2 Matrix-Based Object Representation  
The proposed technique relies on the raster representation of the objects in the matrix space. Let a rectangular design space be described by an empty matrix with \(H\) rows of height and \(W\) columns of width. A rectangular object having a height of \(h\) rows and a width of \(w\) columns can now be modeled within the domain by filling an area consisting of \(h\times w\) entities with ones. The geometries should be approximated for curved shapes and polygons whose edges are not aligned with the rows and columns. Figure 1 shows (a) exemplary matrix space approximations of a circle and a rectangle whose edges are aligned with the horizontal and vertical domain axes, and (b) the sparsity pattern of the matrix containing the objects. The proposed technique does not restrict the edges of the rectangular objects to be aligned with the domain boundaries. Raster approximation of the rotated objects is exemplified with a \(h=0.4H=0.4W\) by \(w=1.5h\) rectangle rotated by an angle of \(\theta=30^{\circ}\) around its top-left corner. Figure 2 shows the sparsity patterns of this object for domain sizes of (a) \(20\times 20\), (b) \(50\times 50\), and (c) \(100\times 100\), which results in 92, 595, and 2414 nonzero entities (\(N_{nz}\)), respectively. As seen in this figure, the shape of the rotated geometry is more accurately captured with increasing resolution. A mathematical convergence can also be observed by calculating the ratio of nonzero entities to the total number of domain entities. When an unrotated rectangle is considered, the exact filling ratio (the proportion of ones to the total number of elements) can be calculated as \(hw/HW=0.24\). For the presented three cases, the filling ratios are computed as \(92/400=0.2300\), \(595/2500=0.2380\), and \(2414/10,000=0.2414\), which converge to the exact value with higher resolution. Increasing the number of raster points inherently lengthens the computation durations [13]. Therefore, excessive discretization resolutions should be avoided to keep the computation durations within reasonable limits. Figure 1: **(a)** Matrix space approximations of a rectangle with \(h=3\) rows height and \(w=4\) columns width, and a circle with \(d=7\) cells diameter. The upper-left corner of the rectangle and center of the circle are located on \((i_{r}=8,j_{r}=2)\) and \((i_{c}=4,j_{c}=7)\), respectively. **(b)** The sparsity pattern of the matrix containing the objects. Figure 2: Sparsity patterns of a rectangle rotated by an angle of \(\theta=30^{\circ}\) around its top-left corner for domain sizes of (a) \(20\times 20\), (b) \(50\times 50\), and (c) \(100\times 100\); which result in 92, 595, and 2414 nonzero entities, respectively. The rectangles have a size of \((h=0.4H,w=1.5h)\). The raster approximations for the rectangles are attained by performing vector inequality operations and elementwise matrix multiplications. In the present study, only top-left corner coordinates of the rectangles are restricted to be integers. The other corners do not necessarily coincide with the matrix grid unlike the conditions enforced with certain raster-based methods such as the Dotted-Board Model [14; 15]. For a rectangle rotated counterclockwise by \(\theta\) degrees, the row and column coordinates of the bottom right corner (\(i_{\theta}\) and \(j_{\theta}\)) can be found as  
\[ \begin{split} i_{\theta}&=i_{r}+h\cos\left(\theta \right)-w\sin\left(\theta\right)\\ j_{\theta}&=j_{r}+h\sin\left(\theta\right)+w\cos \left(\theta\right)\end{split}  \tag{1}\]  
Let \(r_{H}\) be a row vector and \(c_{W}\) be a column vector with elements ranging from \(1\) to \(H\) and \(1\) to \(W\), respectively. Then, the lower and upper boundaries for the rows (\(i_{l}\) and \(i_{u}\)) as well as the columns (\(j_{l}\) and \(j_{u}\)) can be computed as  
\[