Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Projections
- df["SinDir"] = np.sin(df["Dir"])
- df["CosDir"] = np.cos(df["Dir"])
- # Projected speeds
- df['SpeedX'] = df['S'] * df['CosDir']
- df['SpeedY'] = df['S'] * df['SinDir']
- # Expected positions
- for i in range(1, 4):
- df[f'X_in_{i}_second'] = df['X'] + i*df['SpeedX']
- df[f'Y_in_{i}_second'] = df['Y'] + i*df['SpeedY']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement