View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Need help with this vector problem.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

8 replies to this topic

### #1Aj37  Members

Posted 05 October 2001 - 11:30 AM

An air traffic controller notices two aircraft on his radar screen (x-y plane). The first is at altitude 800 m, horizontal distance 19.2 km, and at 25° south of west. The second aircraft is at altitude (z coordinate) 1100 m, horizontal distance 17.6 km, and 20° south of west. What is the distance between the two aircraft? (Place the x axis west, the y axis south, and the z axis vertical). The correct answer is 2285 and I am using the distance formula but I am missing something because I keep getting 8708. I am using this formula d=squareroot((x1-x2)^2+(y1-y2)^2+(z1-z2)^2) z1 = 800 z2 = 100 x1 = 19200sin(25) = 8114 x2 = 17600cos(20) = 16538 y1 = 19200sin(25) = 8114 y2 = 17600sin(20) = 6019

### #2WarMage  Members

Posted 05 October 2001 - 11:43 AM

Shouldn''t everything be (x2-x1)2 and so forth?
-------------
-WarMage
...mmm operational precedence...

### #3Aj37  Members

Posted 05 October 2001 - 11:53 AM

I tried that and I am still getting the incorrect answer

### #4Anonymous Poster_Anonymous Poster_*  Guests

Posted 05 October 2001 - 11:53 AM

NewsLetter, Safelist and Discussion List Hosting for only a \$30 fee. You can setup one on your private servers with NO HASSLE for you. We maintain all the details and your data is backed up multiple times daily.

PlanetXMail.com

### #5cha Mithrandir  Members

Posted 05 October 2001 - 11:02 PM

quote:
Original post by WarMage
Shouldn''t everything be (x2-x1)2 and so forth?

Order doesn''t matter because of the square. Take 2 and 5 for example

(2-5)2 = (-3)2 = 9
(5-2)2 = ( 3)2 = 9

### #6Anonymous Poster_Anonymous Poster_*  Guests

Posted 05 October 2001 - 11:34 PM

Check the API for the cos and sin functions and make sure they take degrees and not radians. Otherwise you''ll have to multiply the degree angles by PI/180 before calculating the sin and cos values. I think.

Good luck.

### #7Abominacion  Members

Posted 05 October 2001 - 11:53 PM

x1 = 19200COS(25) = 17401

------------------------------------------------------
Cuando miras al abismo el abismo te devuelve la mirada.
F. Nietzsche

### #8naos  Members

Posted 06 October 2001 - 11:08 AM

First you need to use your magnatude of components equations
x1 = C * cos(angle)
y1 = C * sin(angle)

so....
x1 = 19200 * cos(25) = 17401
y2 = 19200 * sin(25) = 8114
z1 = 800m <----- leave that as 800 meters
x2 = 17600 * cos(20) = 16538
y2 = 17600 * sin(20) = 6019
z2 = 1100m

Next you need to do is subtract your vectors

simply put.... x2 - x1 = xT = -863
y2 - y1 = yT = -2095
z2 - z1 = zT = 300

Then you would use your distance equation:
D=SqrRoot(xT^2 + yT^2 + zT^2)
D=2285

Hope that helps
-Ian

### #9grhodes_at_work  Members

Posted 09 October 2001 - 02:54 AM

I''m closing this thread and several others because the question appears to be a school homework assignment from a math class. The purpose of homework is to teach students to build their comprehension of a subject and their problem-solving skills, possibly with the assistance of other students in the same class or teachers of the class. Especially for math problems such as the one posed here, it is absolutely NOT appropriate to seek the answers from folks outside one''s class or school.

These forums are to be used for assistance in game development activities only.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.