The dependent and independent variable generally depend on the context.
In the case we want to calculate the distance in function of the speed and the time, the distance is the dependent variable and the speed and time are the independent variables.
In the case we want to calculate the speed, given the distance and the time to cover that distance, the dependent variable is the speed and the independent variables are the distance and time.