Calculate magnitude and direction of resultant vector

Juan Cornetto

New Member
Joined
Mar 5, 2013
Messages
44
I need a formula or VBA or some such to calculate the 2 x magnitude and direction of the resultant vector from two other speed and direction vectors.

The direction in degrees, using 360 degree notation and speed in Knots.


Example
Vector 1 = 360 degs x 30 knots
Vector 2 = 135 degs x 5.8 knots

Re****ant Vector = ??? Degs x ??? Knots

I know it is something to do with the theorem of parallelograms but cannot transpose it to excel.

Any ideas ?:confused:
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
As you probably know, vectors have magnitude and direction. The other key point is that vectors add.
First, calculate (x,y) coordinates for each of the vectors as follows:
x=magintude*sin(direction)
y=magnitude*cos(direction)

So, for the first vector x=30*sin(360)=0 and y=30*cos(360)=30, or (x,y)=(0,30)
For the second vector x=5.8*sin(135)=5.8*.707=4.10 and y=5.8*cos(135)=5.8*(-.707)=-4.10, or (4.10, -4.10)
Since vectors are additive the x value of the final vector is 0+4.10 = 4.10 and the y value is 30-4.10 = 25.9, so the x,y coordinates of the final vector is (4.10, 25.9)

The magnitude of the final vector from the pythagorean theorem is sqrt(4.10^2 + 25.9^2) = 26.22
The heading would be arctan(4.10/25.9)=8.995 degrees
 
Upvote 0
Simply cutting and pasting information directly from a Google search does not help. Juan, you can find several online calculators that can help you, and may even have some information about how to create your own in excel. from what I have read recently the vector's of 0-180 would be from your right to your left with 090 being straight up. coming form an aviation background the Compass Rose dealing with the 360 degrees associated with navigation or direction would generally mean 360 was north and 135 was southeast but I am not familiar with your particular vector's. here is a link to a mathcenter with a pretty good explanation. If you actually want to create your own calculator in excel I am sure someone can help you find a site with the formulas and help you build it in excel.
 
Upvote 0
Juan, you cant use averages for vectors. sorry :)
BadgerRoad's maths is spot on...
to implement this in excelVBA would be something like this:

Code:
Sub trial()
    AddVectors 30, 360, 5.8, 135
End Sub

Sub AddVectors(Mag1 As Double, Dirn1 As Double, Mag2 As Double, Dirn2 As Double)
    Dim MagFin As Double, DirnFin As Double
    Dim CartX1 As Double, CartY1 As Double
    Dim CartX2 As Double, CartY2 As Double
    Dim XFin As Double, YFin As Double
    Const PI = 3.14159265358

    CartX1 = Mag1 * Sin(Dirn1 * PI / 180)
    CartY1 = Mag1 * Cos(Dirn1 * PI / 180)
    CartX2 = Mag2 * Sin(Dirn2 * PI / 180)
    CartY2 = Mag2 * Cos(Dirn2 * PI / 180)
    XFin = CartX2 + CartX1
    YFin = CartY2 + CartY1
    
    MagFin = Sqr(XFin ^ 2 + YFin ^ 2)
    DirnFin = Atn(XFin / YFin) * 180 / PI
End Sub
 
Upvote 0
Diddi's code looks correct, but you don't have to use VBA to solve this problem. I should have mentioned in my post that the trig functions in Excel use radians instead of degrees, hence the multiplication of the headings by PI/180 in Diddi's code.
Not sure what the comment about cutting and pasting from Google search was meant for me or not. Doesn't really matter. I thought running through the formulas would be sufficient and if not I would be more than willing to put them into Excel formulas.
 
Upvote 0
Many thanks Badger Road and all. It all works a treat ! Had a bit of a problem working out how to display the correct quadrant but all sorted.

Thanks again
 
Upvote 0

Forum statistics

Threads
1,215,559
Messages
6,125,517
Members
449,236
Latest member
Afua

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top