On the number of balanced words of given length and height over a two letter alphabet

We exhibit a recurrence on the number of discrete line segments joining two integer points in the plane using an encoding of such segments as balanced words of given length and height over the two-letter alphabet $\{0,1\}$. We give generating functions and study the asymptotic behaviour. As a particular case, we focus on the symmetrical discrete segments which are encoded by balanced palindromes.