Math for X and Z slope points