Earth is not a sphere but a spheroid. I need to ray-trace an spheroid. I think the author can re-derive the formula for a spheroid.