HelpProgram to solve resultant vectors?

Posts 1–9 of 9 · Page 1 of 1
Program to solve resultant vectors?
I would like someone to help me if they could. Where to start. I wanna make a program that automatically solves resultant vectors.
How to solve resultant vectors:

Formulas:
X = MCosΘ
Y = MSinΘ
M = √X2+Y2
Θ = Tan-1(Y/X)


To start we need to find the X,and Y components of the first vector...
Let's says the magnitude of the first vector is 120m. and the Degrees is 15°.
and the magnitude of the second vector is 132m and the degrees is 20°.
We need to do 120Cos15° + 132Cos20° to get the X component of the resultant vector.
Next we do 120Sin15° + 132Sin20° to get the Y component of the resultant vector.
Now we need to find the magnitude of the vector so we use the m = √X^2+Y^2 formula which gives us the magnitude.
Now we need to find the direction (degrees) which is the ArcTan formula.


Any ideas on were to start?
Sounds more like a homework, and why 2 threads?
Quote Originally Posted by xFishx View Post
To start we need to find the X,and Y components of the first vector...
Let's says the magnitude of the first vector is 120m. and the Degrees is 15°.
and the magnitude of the second vector is 132m and the degrees is 20°.
We need to do 120Cos15° + 132Cos20° to get the X component of the resultant vector.
Next we do 120Sin15° + 132Sin20° to get the Y component of the resultant vector.
Now we need to find the magnitude of the vector so we use the m = √X^2+Y^2 formula which gives us the magnitude.
Now we need to find the direction (degrees) which is the ArcTan formula.
You already said everything you need to do... Just translate it to code...
That's how to figure it out. I don't know where to start with the code. Like how to make the program do the math? I'm not so experience with visual basics. That's why i am asking for help.

Sorry Brinuz i accidently posted twice.
All you basically do is rewrite the problems in vb.net

Such as,

A + B + C = D
Code:
Dim A, B, C, D as Double
D = (A + B + C)
To start we need to find the X,and Y components of the first vector...
Let's says the magnitude of the first vector is 120m. and the Degrees is 15°.
and the magnitude of the second vector is 132m and the degrees is 20°.
We need to do 120Cos15° + 132Cos20° to get the X component of the resultant vector.
Next we do 120Sin15° + 132Sin20° to get the Y component of the resultant vector.
Now we need to find the magnitude of the vector so we use the m = √X^2+Y^2 formula which gives us the magnitude.
Now we need to find the direction (degrees) which is the ArcTan formula.

Create 2 magnitude variables
Create 2 degree variables
Create 2 component variables
create resultant magnitude variable
create resultant direction variable

Find the X component of the resultant vector
Find the Y component of the resultant vector
Find the magnitude
find the direction

some pseudo code

Code:
dim magX, magY, angleX, angleY, resultantX, resultantY, resultantMag, resultantDeg as double

resultantX = (magX * cos(angleX)) + (magY * cos(angleY))
resultantY = (magX * sin(angleX)) + (magY * sin(angleY))

resultantMag = sqrt( (pow(resultantX,2) + pow(resultantY,2) )

resultantDeg = atan( (resultantX / resultantY) )
Quote Originally Posted by Auxilium View Post



Create 2 magnitude variables
Create 2 degree variables
Create 2 component variables
create resultant magnitude variable
create resultant direction variable

Find the X component of the resultant vector
Find the Y component of the resultant vector
Find the magnitude
find the direction

some pseudo code

Code:
dim magX, magY, angleX, angleY, resultantX, resultantY, resultantMag, resultantDeg as double

resultantX = (magX * cos(angleX)) + (magY * cos(angleY))
resultantY = (magX * sin(angleX)) + (magY * sin(angleY))

resultantMag = sqrt( (pow(resultantX,2) + pow(resultantY,2) )

resultantDeg = atan( (resultantX / resultantY) )
By 'pseudocode' you mean C/++, with VB variable declarations? Lawl.
it's not C/++ because there are no semicolons

what if I wanted to practice declaring variables in vb?
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us