Skip to main content
GameDev.net gamedev.net
🔒 Locked

vector math

Started by Spintwo Apr 26, 2006 at 4:19 PM 4 replies 650+ views
Original Post
Spintwo
Spintwo
i can't figure out vectors.. if a remote controlled airplane is flying at 15 mph at 70° and then is pushed by wind coming from the left, to the right, the airplane is pushed to a 50° angle. So how do I find how fast the wind is moving and how do I find how fast the airplane ends up travelling? there seems to be two variables here and tha'ts what's throwing me off. for alpha: [15, 70°] beta: [ x, 0°] (wind going east) theta: [ y, 50°] thanks in advance!
matches81
matches81
After reading your post quite a while I finally understood your problem.
I´ll rename your vectors to make it a bit clearer:
Your vector alpha will be called A, vector beta is W (for wind) and vector theta is T.

So according to your example:
The angle between the x-axis and A (most probably the heading of the plane) is 70°, I´ll call that angle alpha. The angle between the x-axis and T is 50°, I´ll call that angle beta. Alpha is the angle before the wind influences the plane, beta the angle after the wind influenced it.

I hope I´m correct so far.

Now, this is how I understand your question:
You want to know how fast the wind was, given that you only know the following:
|A| = 15 (length of A in mph)
W is parallel to x-axis
alpha = 70°
beta = 50°

if this is really your problem:
You´re looking for the wind vector, which is T - A.
The y-components of both vectors A and T are the same, let´s call it y0. Furthermore you know the x-component of A, x0. The only thing you´re missing is x1, the x-component of T.
To get it you can use tan(beta):
   tan(beta) = x1 / y0;=> x1 = tan(beta) * y0;


Now you know both vector A and vector T, and you can calculate vector W = T - A.
The final speed of the airplane is |T|, the speed of the wind |W|.

Hope that helps.
Spintwo
Spintwo
I don' understand where you get the one missing variable i call x (the distance of your vector T)
matches81
matches81
the length of a 2-dimensional vector is sqrt(x² + y²), so in this case if you want to know how long T is, which consists of x1 and y0, you just calculate
|T| = sqrt(x1 * x1 + y0 * y0)W = T - A = (x1 - x0, y0 - y0) = (x1 - x0, 0)=> |W| = sqrt((x1-x0) * (x1-x0)) = x1 - x0


hope this helps
haegarr
haegarr
Quote:
Original post by matches81
=> |W| = sqrt((x1-x0) * (x1-x0)) = x1 - x0

Although this equivalence is correct considering the OP's image (where x1 is greater than x0), I suggest to use the mathematical correct version
=> |W| = sqrt((x1-x0) * (x1-x0)) = |x1 - x0|
or else generally it may happen that the vector's length becomes negative.
haegarr
haegarr
Don't know whether or not the following thoughts are "too deep" for the given problem, but ...

Well, matches81's reply is okay under the given circumstances, but IMHO the original question is somewhat incomplete. Wind is a force. This force is applied to the plane. The fact that the plane changes its flight direction means a sideway acceleration as a consequence of the wind force applied over some time period to the mass of the plane (with some friction coefficient in-between).

So if the wind/plane thingy isn't just for imagination how vector algebra works, the OP's question couldn't be answered w/o leaving some variables in the answer. Reasons for that meaning are (besides others):

1st, why should the y component of the plane's velocity be constant? That means that the velocity of the plane at 50° is greater than it was at the previous direction of 70°. That means that the wind has accelerated the plane also in its direction of flight. That is phyically okay in principle although the increase would seldom match so that y1==y0. However, the assumption lacks any reason given from the original question, doesn't it?

2nd, the computation
velocityplane' := velocityplane + velocitywind
lacks any physically reasoning.


Please ignore all this if the OP's question isn't physics based.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.