title: Curve curvature in numpy
body: <p>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:</p>
  
  <pre><code>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 ]])
  </code></pre>
  
  <p>And the curve looks like this:</p>
  
  <pre><code>plt.scatter(a[:,0], a[:,1])
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/KBjxL.png" alt="enter image description here"></p>
  
  <p><strong>Question:</strong></p>
  
  <p>How can I calculate the tangential and the radial aceleration vectors at each point? I found some formulas that might be relevant:</p>
  
  <p><img src="https://i.stack.imgur.com/Xby4N.png" alt="enter image description here"></p>
  
  <p>I am able to easily calculate the <code>vx</code> and the <code>vy</code> projections with <code>np.diff(a, axis=0)</code> 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?</p>