# Number of lines formed from given points

If these are $$n$$ points out of which $$m$$ are collinear then the total number of lines are

$$= \binom{n}{2}-\binom{m}{2}+1$$ According to what I have thought, when we subtract $$m\choose{2}$$ we remove all the lines possible between the collinear points and then we add a one as there is one line common for all the collinear points. So my question is that if there are two different sets of collinear points then will we add $$2$$ in place of $$1$$ or will the same formula be used , and why?

If there are two different sets of collinear points with $$m_1$$ points in first set and $$m_2$$ points in the second set, then the total number of lines would be
$$N = \binom n2 -\binom {m_1} 2 - \binom {m_2} 2 +2$$
The first term is for the entire possible line set. The second term subtracts the possible lines from the first set of collinear point. Similarly the second term subtracts all possible lines from second set of points. We add $$2$$ in the third term since both sets contribute one line apiece.