Linesum
Linesum refers to the sum of elements that lie along a straight line within a grid-like array, such as a matrix or image. In many contexts, line sums are most familiar as row sums and column sums.
In a matrix A = [a_{i,j}] of size m × n, the row sum for row i is
Line sums can also be defined along lines in directions other than rows and columns, or along
Applications of line sums include data summarization in contingency tables, where row and column margins encode
Notes: the term linesum is used variably across disciplines. In formal contexts, it is usually clearer to