Douglas- Thanks so much for making this available, I was going to pull out the math brain and try to figure out how to do it myself but you saved me many hours!
Thought I’d share this link as well, apparently to convert a file in strava to .tcx you need to:
Add “/export_tcx” – without quotes – to the end of your activity page URL. For example, if your activity page is http://www.strava.com/activities/2865391236 – just add the text to give you http://www.strava.com/activities/2865391236/export_tcx and hit enter. This will download a TCX version of your file to the location specified by your browser’s preferences.
https://support.strava.com/hc/en-us/articles/216918437-Exporting-your-Data-and-Bulk-Export#TCX