You will need to define in your code which direction is the clockwise and which is counterclockwise. You can do that by defining up front a normal vector to your 3D plane that can be used to distinguish this. E.g., something like
PlaneNorm = a 3-element vector defining the normal to the 3D plane for counterclockwise direction
ang = atan2d(norm(cross(v1,v2)), dot(v1,v2));
if( dot(cross(v1,v2),PlaneNorm) < 0 )
ang = 360 - ang;
end
Best Answer