There is a function that can be used for that: std::polar from <complex>.
std::polar
<complex>
Calling std::polar(1.0, theta) returns a std::complex whose real part is cos(theta) and the imaginary part is sin(theta).
std::polar(1.0, theta)
std::complex
cos(theta)
sin(theta)