Update calculate_theta