Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Curve curvature in numpy

Tags:

People also ask

How do you define curvature?

Definition of curvature 1 : the act of curving : the state of being curved. 2 : a measure or amount of curving specifically : the rate of change of the angle through which the tangent to a curve turns in moving along the curve and which for a circle is equal to the reciprocal of the radius.

How do you calculate curved curvature?

How Do You Measure Curvature of a path? The curvature(K) of a path is measured using the radius of the curvature of the path at the given point. If y = f(x) is a curve at a particular point, then the formula for curvature is given as K = 1/R.


I am measuring x,y coordinates (in cm) of an object with a special camera in fixed time intervals of 1s. I have the data in a numpy array:

a = np.array([ [  0.  ,   0.  ],[  0.3 ,   0.  ],[  1.25,  -0.1 ],[  2.1 ,  -0.9 ],[  2.85,  -2.3 ],[  3.8 ,  -3.95],[  5.  ,  -5.75],[  6.4 ,  -7.8 ],[  8.05,  -9.9 ],[  9.9 , -11.6 ],[ 12.05, -12.85],[ 14.25, -13.7 ],[ 16.5 , -13.8 ],[ 19.25, -13.35],[ 21.3 , -12.2 ],[ 22.8 , -10.5 ],[ 23.55,  -8.15],[ 22.95,  -6.1 ],[ 21.35,  -3.95],[ 19.1 ,  -1.9 ]]) 

And the curve looks like this:

plt.scatter(a[:,0], a[:,1]) 

enter image description here

Question:

How can I calculate the tangential and the radial aceleration vectors at each point? I found some formulas that might be relevant:

enter image description here

I am able to easily calculate the vx and the vy projections with np.diff(a, axis=0) but I am a numpy/python noob and it is way over my head to continue. If I could calculate the curvature at each point, also my problem would be solved. Can somebody help?