I have a list of coordinates (coord):
{{59.1915, 42.0843}, {62.0695, 71.2996}, {48.4124, 52.1423},
{51.3325,60.8624}, {54.8544, 44.72}, {55.39, 63.9032},
{59.1566,67.2319}, {48.1271, 57.0733}, {63.0908, 76.0996},
{50.644, 47.5917}}
Using:
diffcoord = Differences[coord]
I can calculate the difference between consecutive coordinates:
{{2.87796, 29.2153}, {-13.6571, -19.1573}, {2.9201, 8.7201},
{3.52192, -16.1424}, {0.53561, 19.1832}, {3.76663, 3.32865},
{-11.0295, -10.1585}, {14.9637, 19.0262}, {-12.4468, -28.5079}}
Now, I want to calculate:
d = dx1*dx2 + dy1*dy2
for each pair of differenced coordinate in the list. where $dx_1 = x_2-x_1, dy_1=y_2-y_1$ (which is the first element of the diffcoord list)
I was trying to use Dot
but I found out that it's not going to do I want. Is there a command like Differences
or Accumulate
that does what I need.
More info:
I am trying to calculate the correlation between unit tangent vectors (uni-leipzig.de/~pwm/web/?section=introduction&page=polymers). To calculate unit tangent vector, I need to take the derivative of the curve at that point. Since it's cubic spline, I can't do so. I am trying to approximate it by (iiserpune.ac.in/~cathale/lects/bio322-phybio1/2013bio322/…) . Do you know of any better way to do it?
This question is a follow-up to this question: How to find a length of a curve constructed using Spline?
Dot @@@ Partition[(* coordinates *), 2, 1]
. $\endgroup$