Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. # Projections
  2. df["SinDir"] = np.sin(df["Dir"])
  3. df["CosDir"] = np.cos(df["Dir"])
  4.  
  5. # Projected speeds
  6. df['SpeedX'] = df['S'] * df['CosDir']
  7. df['SpeedY'] = df['S'] * df['SinDir']
  8.  
  9. # Expected positions
  10. for i in range(1, 4):
  11. df[f'X_in_{i}_second'] = df['X'] + i*df['SpeedX']
  12. df[f'Y_in_{i}_second'] = df['Y'] + i*df['SpeedY']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement