Solve for θ 0<=theta<=2pi