This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Retime a tracked object to better fit a target curve | |
# Select two Transform nodes: the first with a jerky tracked curve, the | |
# second with a smooth target curve | |
# Group effort by Lewis Saunders, Unai Martínez Barredo, Erwan Leroy | |
# Make a function to calculate the distance between two points | |
def distance(a, b): | |
return pow((a[0]-b[0])**2 + (a[1]-b[1])**2, 0.5) | |
# Find the closest point to p on the line ab |