AE will do the trig for you. You should be able to use the same expression for Starting Point and Ending Point, just swapping the track point references. For example, you could use something like this for Starting Point:
myTrack = thisComp.layer(“tracked layer”).motionTracker(“Tracker 1”)(“Track Point 1”).attachPoint;
otherTrack = thisComp.layer(“tracked layer”).motionTracker(“Tracker 2”)(“Track Point 1”).attachPoint;
s = effect(“Slider Control”)(“Slider”);
v = normalize(myTrack – otherTrack);
myTrack + v*s
And this for Ending Point:
myTrack = thisComp.layer(“tracked layer”).motionTracker(“Tracker 2”)(“Track Point 1”).attachPoint;
otherTrack = thisComp.layer(“tracked layer”).motionTracker(“Tracker 1”)(“Track Point 1”).attachPoint;
s = effect(“Slider Control”)(“Slider”);
v = normalize(myTrack – otherTrack);
myTrack + v*s
Dan