I came across a problem similar to this, when I wanted to use the "Image Offset" checkbox in the Edit Strip tab of the VSE:
How can I add some 'blurry-ness' to a video clip, when I animate the x-component (or y-component) with key-frames?
My solution was to use the Node Compositor and couple of Drivers;This doesn't calculate a slope value, but you may be able to refine it, using the concept:
Slope (M) = Y/X, where Y = (Y1)-(Y2) and X = (X1)-(X2), representing two points (X1,Y1) and (X2,Y2) equally spaced from point (X,Y) on a graphed line or curve. I'm sure that someone can come up with a better definition, that this one.
I don't think that Blender has a function for this (yet) in the compositing nodes (as of Blender 2.79), but they do have 'value' nodes and 'math' nodes that can derive M, if you can get the values of (X1,Y1) and (X2,Y2) at the same time.
So, instead of trying to get two points on the same curve (or line) at the same time, I caused Blender to generate one point on two similar curves (at the same time).
Do this by animating an object, somewhere in a Scene. The object should have all the keyframes and interpolated motion elements that you want your video strip to have (I used an 'empty' object). After every movement is to your liking, use 'shift-d' to duplicate the original object. Then, in the F-Curve editor, select and move all the keyframes for the duplicate object ahead by one frame. I used this key-board command:
(toggle 'all' key-frames on)
(Go in the X-direction 1(frame)
Now, at any frame number on the Timeline, I can compare the X or Y components of these objects to see if they are becoming closer, or farther apart. With this information, I can animate the 'Vector Blur' node's Speed input to change the amount of blur that is added to the animated displacement('Displace' node).
Composite Node Editor - Detecting speed of movement with two drivers (from Original and Duplicate objects) and applying to video. This causes motion blur to be exaggerated while video displacement is animated. This example (though poor) is only meant to blur in X-axis. It's not perfect, but its what I've got.
The numbers in the Value nodes are generated by drivers, linked to X-axis data of my two objects.
These values, in my example, are so large that the scale of the grid in the main blender 3D view becomes almost un-seeable. Blender didn't complain, though.
For most of the frames, the location values are equal, meaning a 'zero-value' for speed input to the Vector-blur node. But a difference between the values comes when the first empty object has a head-start on the timeline.
This example is not really 'slope', even according to my own definition. but it gets the blur going, close enough to where I need it. further refining is needed, but I'm out of time.