PDA

View Full Version : Spreadsheet calculation


SkidSolo
27th Sep 2002, 17:06
All I am trying to do is put in equation form the angle between wind and a track in order to calculate h/w and t/w components.

For example, wind 270, track 340 is 70 deg off. It works like (W-T)*-1 or wind 270, track 020 is 110 deg off but it would be 250 so a 180 has to be thrown in. I ended up with so many different permutations it made my head spin and there has to be an easier way.

I never was any good at programming logic perhaps one of you can come up with a simple "if X then Y=Z" kind of thing.

Thanks in advance.
SS

Young Paul
27th Sep 2002, 19:11
I think you need to start from the most complex case, and reduce it. Somebody correct me if I go wrong - my maths is pretty underused these days.

Given a triangle with sides of lengths a,b,c and an angle between a and b of C (that ought to be theta or at least something greek, but there you go), then

c squared equals a squared plus b squared minus two times a times be times cosine x.

Also, if you have a triangle with sides a, b, c opposite vertices A, B, C, then:

a divided by sine A equals b divided by sine B equals c divided by sine C.

So if you know your wind vector and your heading vector and speed, you know the lengths of two sides and the difference between the angles of two sides. From this, you can work out everything else.

If you are using sines and cosines, you don't need to worry about whether one angle is more than another, because most calculations aren't fussy about getting an angle in the range 0 to 360 - they will work it out modulo 360. If it is fussy, then do the modulo 360 bit yourself first. If it insists on radians (does anything, these days?) then do that bit first.


Alternatively, use a flight computer.....

oxford blue
27th Sep 2002, 19:23
You will find your answer here (http://williams.best.vwh.net/avform.htm) .

I recommend it. It's very good.

Captain Stable
27th Sep 2002, 22:07
Skid, if you want to email me, I have an XL spreadsheet that does it.