See https://en.wikipedia.org/wiki/Lebedev_quadrature There are implementations all over in all languages. See gsl. Lebedev, V. I. (1976). "Quadratures on a sphere". Zh. Vȳchisl. Mat. Mat. Fiz. 16 (2): 293–306. [doi](https://en.wikipedia.org/wiki/Doi_(identifier)):[10.1016/0041-5553(76)90100-2](https://doi.org/10.1016%2F0041-5553%2876%2990100-2)
See https://en.wikipedia.org/wiki/Lebedev_quadrature
There are implementations all over in all languages.
See gsl.
Lebedev, V. I. (1976). "Quadratures on a sphere". Zh. Vȳchisl. Mat. Mat. Fiz. 16 (2): 293–306. doi:10.1016/0041-5553(76)90100-2