how about Calculating custom angles

Hello everybody ,
There is a DMSO molecule that is shown below . I want to compute the orientation of DMSO by using lammps , which is defined by the angle θ between the vector SO (from the sulfur atom pointing to the oxygen atom) and the z-direction . Can I compute the angle θ with lammps ? How do I set it up ?
I would appreciate it if anyone could give me some advice .

with regards!
Outlook-yefzr1ls.png

this is something people usually do through post-processing of their trajectories.
the best i can think of that can be done in LAMMPS would be to compute the dipole vector per molecule (via compute chunk/atom and compute dipole/chunk) and then further analyzing that result with a custom script/program.

axel.

Outlook-yefzr1ls.png

Thank you very much for your advice , Axel.

Outlook-yefzr1ls.png