Does anyone have a component for calculation the torsion angle in a small molecule ?

Hi,
I need to calculate torsion angles in a set of small molecules (not peptides).  I have looked into creating a component that would calculate the angle when given the 4 atom numbers.  PilotScript doesn't appear to have the vector geometry needed, and I haven't used the perl property calculator before...So, if anyone has one already, it would save me some time developing one.  (don't particularly want to redevelop the wheel here....)
Thanks !
Di