# Vector help needed

1. Aug 10, 2012

### whiskeygirl

Ok, so I'm trying to find the vectors v1 and v2 that point from the positions to a sighting. It says the form must be in <a,±1,b> form, and calculations to 3 significant digits. Position 1: (3500, 450, 800) and the sighting is 30° south of west, and 0.83° above the horizontal. Position 2: (200, 1650, 600) and the sighting is due south, 4.70° above the horizontal.

I honestly have no idea where to start, but I was thinking maybe it would be something along the lines of the magnitude of position 1 which is 3,618.356, and do that multiplied by cos30°, and then sin30°, then I'm not sure what to do with the 0.83* above the horizontal part. But, I'm not sure.

2. Aug 10, 2012

### dydxforsn

Re: vector help needed ASAP

Hmmmm, it's pretty hard to tell what you're asking for. If you're asking for vectors that point in the direction of the sightings, then one could choose any magnitude for the vector and position 1 and 2 would be irrelevant because vectors are absolute position independent (it wouldn't matter which point you use!)

You may at some point want the unit vectors in the sighting directions so I can walk you through that for now. To form a unit vector pointing 30° south of west, and 0.83° above the horizon (and assuming positive $\hat{x}$ is east, positive $\hat{y}$ is north, and positive $\hat{z}$ is up..) you can first project a unit vector onto the xy-plane and then project THAT vector into the 'x' and 'y' directions. So that would be something like <(1 * cos(0.83°)) * -cos(30°), (1 * cos(0.83°)) * -sin(30°), sin(0.83°)> or <-cos(0.83°)cos(30°), -cos(0.83°)sin(30°), sin(0.83°)>. You can verify that the magnitude is 1. I have a feeling that that may be useful for you depending on what your problem is.

3. Aug 10, 2012

### LCKurtz

The magnitude of position 1 or 2 has nothing to do with it. Those positions just give locations. The problem appears to require you to write the equations of the lines through the given locations using direction vectors calculated from the given data. Then find where they intersect. They might not exactly intersect due to round off errors in calculations.

4. Aug 11, 2012

### Ray Vickson

If a = (3500,450,600) and b = (200,1650,600) and if p = first sight-line vector (defined by the first angles you gave) and if q = second sight-line vector, you get two lines in 3-space. These are L1: x1(s) =a + s*p and L2: x2(t) = b + t*q, where s and t are scalars. As s and t range over the real line, x1 and x2 trace out two lines, which are the estimated sightlines that pass through the object you want to locate. The intersection of these lines gives the position of the object; this will happen if the three simultaneous equations a1+s*p1 = b1 + t*q1, a2+s*p2 = b2+t*q2 and a3+s*p3 = b3+t*q3 have a consistent solution (s,t).

However, because of experimental (measurement) errors and roundoff, the two estimated lines L1 and L2 may not intersect in practice. In that case it makes sense to find the two points (one on L1 and the other on L2) that are as close as possible to one another, that is, to minimize the distance ||x1(s) - x2(t)||. That gives an unconstrained optimization problem in s and t. If the resulting two points are very close together (using some definition of 'very close') then it makes some kind of sense to use a point close to them (for example, one of them, or their average, or something similar) as your estimate of the object's location.

RGV

5. Aug 12, 2012

### LCKurtz

I ran it through Maple and the two lines do in fact not intersect. So the system is inconsistent. I simply solved the x and y equations and used those values of s and t and not worry about the fact that the whole system is inconsistent. The z values came out very "close" as you might expect.

Last edited: Aug 12, 2012
6. Aug 12, 2012

### Ray Vickson

I used Maple to solve the minimum distance problem and as you found, the lines do come close.

RGV