added min_all_cos_dtheta functionality for convenience.