How to get vector orientation from dihedral angles

No.13346851 ViewReplyOriginalReport
Hi /sci/, I'm stuck on a geometry problem I was hoping you could help me with. Pic related is cellobiose. Basically, I want an analytical expression that gives me the orientation of the right hand vector (in blue, between carbons 4 and 1) as a function of the two dihedral angles phi and psi, shown in red and green, and the left hand vector in blue (can assume something simple for this like (1, 0, 0)).

The structure is rigid, and I have access to any of the lengths and angles within each sugar monomer. At first I was thinking to simply try and relate the vectors O-1 and 4-3 (tails of the dihedrals). I'm shit at this geometry/rotation matrices stuff (chemist by training) and hoped to at least get some pointers (i.e. WHAT maths to use for this).

For context, I want to write a program that can quickly calculate how curved a long sugar polymer (many units) is as a function of its average dihedral angles. This lets me calculate its 'static' persistence length so that I can see how dynamically flexible it is over the course of a simulation. This means I can avoid overestimating a given chain's flexibility if its minimum energy structure is already quite curved.