Assume a matrix of size 3 x 3 (n x n). In this case, n =3
From a solution, it stated that all the diagonals (i , j) has the same value using this formula [(i + (n-1 -j)) mod n]
for example, below, the main light blue diagonal coordinates (0,0) , (1,1) , (2,2) . all has a value of 2 [using (0,0) as an example, formula (0 + (3-1-1)) mod 3 = 2]
also, the dark blue diagonal (1,0), (2,1), (0,2), all has value of 1
I tried to search the internet and could not see anything article related to this formula. I like to understand the rationale behind it in layman terms so that I do not have to memorize it. Anything that can help me understand it more will be great. Thanks!!!
From a solution, it stated that all the diagonals (i , j) has the same value using this formula [(i + (n-1 -j)) mod n]
for example, below, the main light blue diagonal coordinates (0,0) , (1,1) , (2,2) . all has a value of 2 [using (0,0) as an example, formula (0 + (3-1-1)) mod 3 = 2]
also, the dark blue diagonal (1,0), (2,1), (0,2), all has value of 1
I tried to search the internet and could not see anything article related to this formula. I like to understand the rationale behind it in layman terms so that I do not have to memorize it. Anything that can help me understand it more will be great. Thanks!!!