- #1

- 13

- 0

## Main Question or Discussion Point

**"roots" command in MATLAB**

Hey everyone. I'm a new user to Matlab. I must say, it's an awesome program, but not user-friendly at all. I'm having trouble trying to use the "roots" functon. Here's what part b of my problem states:

"Use the roots function to compute the time when the aircraft are first within 30 miles of each other."

The first part of the problem asks me to obtain an expression for the distance "D" between two aircraft as a function of time, for which I have: D=sqrt((800-320*t)^2+(410-160*t)^2) a.k.a. the distance formula.

Since they are asking for the time when they are first within 30 mi of each other, I have set D=30. This gives me: 30=sqrt((800-320*t)^2+(410-160*t)^2). I then used Wolfram Alpha and came up with 2 values for t: 2.43246 and 2.59254. I'm guessing the latter number would be correct, because the problem is set up like a giant triangle, D being the hypotenuse, which decreases as the planes fly closer together.

Can anyone help me set this up using the "roots" equation? I can clarify more if needed. Thanks in advance,

Josh