Lens math and calculations