bool OEGetRadiusOfGyration(double* radiusOfGyration, const double* pmi, const OEMolBase& mol)
bool OEGetRadiusOfGyration(double* radiusOfGyration, const double* pmi, const OEConfBase& mol)
bool OEGetRadiusOfGyration(double* radiusOfGyration, const double* pmi, const OEMCMolBase& mol)

Calculates the radius of gyration of the given molecule, using the given PMI that has already been calculated with the function OECalcPMI. Units of the calculated radius are the same as those used to set the radius of the molecule, which need to be the same radius units used to calculate the PMI.

The function returns true if calculation is successful, false otherwise. If the molecule is not centered, or radius of gyration values are all 0, the function will return false,

Note that for an OEMCMolBase, the OECalcPMI only calculates the PMI for the active conformer, and therefore this function similarly uses only the mass of the active conformer to calculate the radius of gyration.


This double array will be populated by the radius of gyration in each dimension, X, Y, and Z.


This is a pointer to the PMI of the given molecule in each dimension, in X, Y, and Z.


This is the molecule for which the PMI is calculated. It must have a set radius and set mass for the calculation to be valid.


These functions only work correctly with a molecule that has been centered using the function OECenter. If the molecule has not been centered, the function will return false.

See also

  • OECalcPMI function to calculate principle moment of inertia.

The following code snippet demonstrates how to calculate the PMI and radius of gyration for a molecule.

package openeye.docexamples.oechem;

import openeye.oechem.*;

public class CalcPMI {
    public static void main(String argv[]) {

        int i, j, k;
        for (i = 0; i < argv.length; i++) {
            String inp_filename = argv[i]; 
            OEGraphMol omol = new OEGraphMol(); 
            oemolistream ifs = new oemolistream(inp_filename);
            OEDoubleArray pmi = new OEDoubleArray(3); 
            OEDoubleArray rGyr = new OEDoubleArray(3); 
            while (oechem.OEReadMolecule(ifs, omol)) {
                oechem.OECalcPMI(pmi, omol);
                for (j = 0; j < 3; j++)
                    System.out.print(pmi.getItem(j) + " ");
                oechem.OEGetRadiusOfGyration(rGyr, pmi, omol);
                System.out.print("Radius of Gyration");
                for (k = 0; k < 3; k++)
                    System.out.print(rGyr.getItem(k) + " ");