I want to find a formula to calculate the number of dispersion lines I can draw from any one corner of a square dot matrix of size $n \times n$.
By dispersion lines, I mean the lines that connect a particular point to all other points in a dot diagram. Here's a picture of what I mean :
(That's an approximate diagram of what I mean; sorry for the crude diagram)
Here, the horizontal blue line on the top row (when considered a straight line) connects many dots to a single point (thus all those dots on the line are collinear), so when we count the number of dispersion lines, we have to count lines connecting many collinear points as one and we mustn't take the subunits into consideration.
So when we consider a square dot matrix, where the dots are arranged as a square, we can draw $3$ apparent dispersion lines, plus some more. What I would like to find is a formula to calculate the number of dispersion lines in square dot grids (or dot matrices).
What I have at hand is this one formula that I tried to formulate today:$$n^2 - (n + 2(n - 1)) + 3$$ The problem is that this formula isn't working for all values of $n$ (I mean, the number of dots in a column/row of the square dot matrix), and also I haven't been able to spend sufficient time to find the number of dispersion lines for $n > 5$. If asked for, I'll attach the numbers below.
Any help in formulating an accurate formula is appreciated. If such a formula exists, please do tell me.
Thanks in advance.