calc second deriv of roation