Hi,

I am hoping someone can help me with this.

Background:

I am writing a program to automate some finite element analysis. My program initally describes a setof connected lines which can be directed anywhere in 3D space. I then mesh these lines with elements that have an orientation vector perpendicular to the lines.

What I need to do is determine the element orientation vector from points describing the lines and the angle of rotation at the apexs. I do this by defining an initial orientation vector and then using Rodrigues' Rotation Formula to rotate the vector as required, which appears to be working (although I have only tested simple examples so far).

The Problem:

The problem I am having is this: The angle that decribes the rotation is always an angle less than pi and rotation is always anti-clockwise. However I need my orientation vectors to always remain on the same side of the curve. I have attached a couple of small diagrams to help demonstrate this (i think the rotation arrows point the wrong way - please excuse this).

I am looking for a way to tell if I need to reverse the direction of the vector I obtain after rotation.

I hope that this is explained okay, please let me know if you need more information and if any help given could be in fairly simplistic terms it would be appreciated, my maths isn't great.

Thanks in advance

Robyn