“cmd.get_dihedral” returns the dihedral angle between four atoms. By default, the coordinates used are from the current state, however an alternate state identifier can be provided.
By convention, positive dihedral angles are right-handed (looking down the atom2-atom3 axis).
cmd.get_dihedral(atom1,atom2,atom3,atom4,state=-1)
def get_dihedral(atom1="pk1",atom2="pk2",atom3="pk3",atom4="pk4",state=-1,quiet=1):