I am trying to find the rotation angle of a 2D vector. I have found a few questions that use 3D vectors. The following df represents a single vector with the first row as the origin.
d = ({
'X' : [10,12.5,17,20,16,14,13,8,7],
'Y' : [10,12,13,8,6,7,8,8,9],
})
df = pd.DataFrame(data = d)
I can rotate a vector using the following equation:
angle = x
theta = (x/180) * numpy.pi
rotMatrix = numpy.array([[numpy.cos(theta), -numpy.sin(theta)],
[numpy.sin(theta), numpy.cos(theta)]])
But I'm not sure how I would find the angle at each point of time using the coordinates listed above. Apologies for using a df. It replicates my actual dataset