Two cars are approaching an intersection. One is 3 miles South of the intersection and is moving at a constant speed of 40 mph. At the same time, the other car is 4 miles East of the intersection and is moving at a constant speed of 50 mph. Express the distance d between the cars as a function of time t.