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