Thursday, September 27, 2012

Scalar Product- Closest Approach

Okay, this seems a bit too complex for a first post, but I wanted to share what I learned today. Or at least what I think I've learned. If I'm totally wrong, please do share because then I could learn from it. One day, I'll go back and write about topics that lead up to this.

I was struggling with this question in my Spec homework, but I think I've got it now.

Here's the question:

Two walkers Harry and Claire are at (30, -17) km and (18, 15) km at 9.30am Saturday, travelling with velocities of (6, 4) km/h and (8, -2) km/h respectively.
a) Find the closest distance that they come to each other.
b) Find the time when they are closest.
c) Find the positions of Harry and Claire when they are closest.
d) Find Harry's position relative to Claire's position as a distance and bearing when they are closest.

The first thing that I did was do some adjusting to make Claire appear to "stand still" at the origin while Harry moved. It's easier to work with an object moving near a still object than with two moving objects.

To do this, I subtracted Claire's position vector from both Harry and Claire's position vectors:

r(C) = (18i + 15j) - (18i + 15j) = 0i + 0j (the origin)
r(H) = (30i - 17j) - (18i + 15j) = 12i - 32j (this is the same as the position vector of Harry relative to Claire)

Next I made Claire "stand still" by subtracting Claire's velocity vector from both Harry and Claire's velocity vectors:

V(C) = (8i - 2j) - (8i - 2j) = 0i + 0j (at rest)
V(H) = (6i + 4j) - (8i - 2j) = -2i + 6j (this is the same as the velocity vector of Harry relative to Claire)

Now we have C at rest at the origin, and H at (12i - 32j) km travelling with the velocity of (-2i + 6j) km/h, as in the diagram below (not to scale):


Now, as you hopefully already know, when working out closest approach, you need to find the spot where the line between the point C and the line H is perpendicular to the line H. If that didn't make sense, here is a diagram:


The thick blue line is the shortest distance between C and the line H.

But how should we go about working out how long this line is? First, we let the point where the two lines meet be Point P.

Next, we work out the vector equation for the red line, which is relatively easy:

H = 12i - 32j + t(-2i + 6j) (where t is time in hours)
H = (12 - 2t)i + (6t - 32)j

Now we have to find the position vector of point P. Since P lies along the line H, the position vector of P is simply (12 - 2t)i + (6t - 32)j. We just need to find out what t is, and we'll get to that eventually.

Now, since CP (which is equal to the position vector of P since C is at the origin) is perpendicular to HP, CP(dot)HP is equal to 0. This gives us the following equation:

((12 - 2t)i + (6t - 32)j)(dot)(-2i + 6j) = 0

You might want to know why I don't have to work out what HP is and why I'm just using the velocity vector of line H. Let's just say that two lines, A and B, are perpendicular, that is, they meet at a 90 degree angle. Line A will also be perpendicular to any other line that is parallel to B due to corresponding angles in parallel lines, as can be seen in the diagram below. The vector equation of the line is (point on the line) + (scalar multiple of direction of line). Since only the direction contributes to the gradient of a line, the position vector is irrelevant if you only care about parallel and perpendicular lines, and therefore it can be omitted in this case.


Sorry if that was a terrible explanation. Anyway, back to the original problem at hand:

((12 - 2t)i + (6t - 32)j)(dot)(-2i + 6j) = 0 expands to
-24 + 4t + 36t - 192 = 0 which then simplifies to
40t = 216
t = 5.4

Yay, we now have a t value, so we can work out what the position vector of P is by substituting this value in! Since the position vector of P is equal to CP, finding the magnitude of this will give you the shortest distance!

CP = (12 - 2(5.4))i + (6(5.4) - 32)j
| CP | = 1.26km (2 d.p.)

a) The closest distance between Harry and Claire is 1.26km (2 d.p.).

You can also use the t-value from before to get answer the second part. Just convert 5.4 hours to hours and minutes and add it to 9.30 am, and away you go!

5.4 hours = 5 hours 24 minutes
9.30am + 5 hours 24 minutes = 2.54pm

b) The time at which they are closest is 2.54pm.

It's easy to find the position vectors of Harry and Claire when they are closest. First you have to go way back to the beginning of the question- before you stopped Claire and confined her to the origin. The vector equation for Claire's original movement is (30i - 17j) + t(6i + 4j) and the vector equation for Harry's original movement is (18i + 15j) + t(8i - 2j). Substituting our t-value into these equations will give you the position vectors of Harry and Claire when they are closest.

c) Harry is at (62.4, 4.6) while Claire is at (61.2, 4.2).

The last part isn't too hard either. All you have to do is work out the differences in x-values and the differences in y-values between Harry and Claire. By doing some simple subtraction you can see that Harry is 1.2 km east and 0.4 km north of Claire. I then put this into a simple diagram:


This part should hopefully be really simple. To find the position of Harry relative to Claire as a distance, just use Pythagoras' theorem: sqrt(0.4^2 + 1.2^2). This should hopefully give the same minimum distance as in part a). The bearing is likewise not too difficult. Just use arctan(0.4/1.2) to get the angle. Then, since the angle is in the first quadrant, subtract the angle from 90 degrees to get your bearing.

d) Harry's position relative to Claire's position is 1.26km on a bearing of 71.57 degrees (2 d.p.)

Hopefully my method helped you and I'm not teaching you any wrong methods! If any of you find anything that needs fixing, please tell me so that I don't confuse a bunch of other people...

No comments:

Post a Comment