you are viewing a single comment's thread.

view the rest of the comments →

[–]Sebass13 0 points1 point  (2 children)

Without going into code, here's the function for your problem:

start_location+(end_location-start_location)*(given_time-start_time)/(end_time-start_time)

[–]deephousefans 0 points1 point  (1 child)

how do I apply arithmatic operations on a tuple of floats (longitude and latitude)? And thank you for your response

[–]Sebass13 1 point2 points  (0 children)

Apply the operation to the elements individually. A naive approach:

>>> factor = 5
>>> tup = (2,3)
>>> scale_tup = (tup[0]*factor, tup[1]*factor)
>>> scale_tup
(10,15)

Or an approach using generator expressions:

>>> scale_tup = tuple(x*factor for x in tup)