How to calculate the root-mean-square radius of gyration and end-to-end point?

Material Studio can give the end-to-end piont and radius of gyration, How can we calculate the root-mean-square value of them? direct integrals?