Math Behind Virtual Scrolling