I have some data sets and using that data sets I'm trying to calculate the rotation numbers. Calculating rotation numbers I have to take some particular direction of vectors, i.e., either clockwise or anticlockwise. I'm able to do clockwise orientation. But facing difficulty with anti-clockwise orientation. Could anyone please help me with this? I'm pasting my code here
centralPoint = {24.21472610092954`,
3.5934127487768646`*^-6}; seqOfAng =
Table[initialPoint = Xdata[[i]]; subsequentPoint = Xdata[[i + 1]];
v1 = Simplify[initialPoint - centralPoint];
v2 = Simplify[subsequentPoint - centralPoint];
unitVector1 = v1/Norm[v1];
unitVector2 = v2/Norm[v2];
(* A positive determinant between two vectors means that the angles \
have an anti-clock wise orientation. So,
we impose the condition that if the angle is in anti-clock wise,
the angle should be changed in clock wise direction. *)
angle =
If[Det[{v1, v2}] >= 0,
N[2 Pi - VectorAngle[unitVector1, unitVector2]],
N[VectorAngle[unitVector1, unitVector2]]], {i, 1,
Length[Xdata] - 1, 1}]; rotNum = N[Mean[seqOfAng]/(2 Pi )]
Using different data sets I got the plot for clockwise rotation But I want the plot like this one. So maybe this is due to the different direction of anlge rotation.
Can anyone please help me with this? How to calculate all angles in a counter-clockwise direction? Does the plot have opposite direction if we have all angles in opposite directions?
I'm not able to add the data set here. Can I add at least one data set here? How to add?