Derive Formula For Midpoint Circle Algorithm