I'm running a MD simulation (in Gromacs) of dye molecules incorporated into polymer to determine how that system responds to external electric field.
There are two order parameters that are used to describe such systems: $<\cos\theta>$ and $<\cos^3\theta>$, where $\theta$ being the angle between dipole moment of dye molecule and the direction of electric field, and averaging is over the ensemble of dye molecules.
I'm thinking of writing a script, that will find 3 specific atoms in each dye molecule, and with a help of linear algebra will determine orientation of that molecule. That way, assuming the dipole moment isn't changing during MD run, I'll be able to calculate that parameters.
The problem is I'm not very good in linear algebra and programming, so I'm wondering is there any software that can calculate such parameters?