Consider a set of real numbers $S=\{ a_1, a_2, \ldots, a_n\}$ and $\mu$ denotes the mean of all the points. Consider a number $z$, then it is known that - $$\sum_{i=1}^n (z-a_i)^2 = \sum_{i=1}^n (a_i - \mu)^2 + |S|(z-\mu)^2$$
For proof see this answer. However, I am unable to visualise this fact geometrically on a number line. Without the proof, if I look at the above equation, it does not look immediately logical to me. How do I convince myself about this result geometrically?