Questions about modifying the order parameter in spatial orientation correlation function

Hi there,

I have a chain of polystyrene. Say, I have defined a vector connecting the C1 position and C6 position for each phenyl group in the polymer. Now I would like to evaluate the orientation of these vectors with respect to vector Z. I know this can be done by the spatial orientation correlation function with a script containing the command. However, I also want to know whether the defined vector (connecting C1 and C6) in the phenyl group is in the same or opposite direction to the vector Z. Obviously, the spatial orientation correlation function could not tell me information about this, as in its equation, the cosine term is to the power of 2, which will always make the order parameter positive from 0 to 1. Is it possible to have a script, which modifies the cos term in the equation so that the order parameter can be either 1 (exactly same direction as vector Z) or -1 (exactly opposite direction to vector Z)? I am doing my simulation in Materials Studio 5.0.

Regards,

Jeremy