for calculating the trajectory of an object