Final answer:
To calculate the distance D between the two aircrafts as a function of time, use the formula D = sqrt((x2 - x1)^2 + (y2 - y1)^2). Plot D versus time until D reaches its minimum value. Use the roots function in MATLAB to compute the time when the aircraft are within 30 mi of each other.
Step-by-step explanation:
To calculate the distance D between the two aircrafts as a function of time, you can use the formula D = sqrt((x2 - x1)^2 + (y2 - y1)^2), where (x1, y1) and (x2, y2) are the coordinates of aircraft A and B respectively. Since aircraft A is flying east at 320 mi/hr and aircraft B is flying south at 160 mi/hr, you can represent their positions at any time t as (x1, y1) = (320t, 0) and (x2, y2) = (0, -160t) respectively.
By substituting the coordinates into the formula, you can obtain the distance D as a function of time. To plot D versus time until D reaches its minimum value, you can create a time array and calculate D for each time value. Then, you can use the plot function in MATLAB to create the plot.
To compute the time when the aircraft are first within 30 mi of each other, you can find the roots of the equation D = 30 using the roots function in MATLAB. The roots function will provide the time values when the distance D is equal to 30 mi.