Pre-calculate diagonal rod length squared