• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Cross wind formula help

Messages
47
Country
us-california
Hi,
I have the following formula for calculating cross wind and it works using a hand calculator inputing in degrees, but converting to radians it does not convert. So what I am asking for is input on how to convert the formula for use in a gauge.

Head- and cross-wind components.
HW= WS*cos(WD-RD) (tailwind negative)
XW= WS*sin(WD-RD) (positive= wind from right)

where HW, XW, WS are the headwind, crosswind and wind speed. WD and RD are the wind direction (from) and runway direction. AH is aircraft heading.
As usual, unless you have a version of sin and cos available that takes degree arguments, you'll need to convert to radians.

Example: Wind 060 @ 20 departing Runway 3.
WS=20 knots
WD=60 degrees = 60*pi/180 radians
RD=30 degrees = 30*pi/180 radians or
AH=xx degrees = xx*pi.180 radians
Plugging in:
Headwind=17.32 knots
Crosswind = 10 knots (from right)

using the above formula I converted the degrees to radians
60 degrees = 1.0472 radians 30 degrees = 0.5236 radians. XW=20 * sin(1.0472 - 0.5236) = 20 * sin(0.5236) = 20 * 0.009138 = 0.11276 which is not correct answer.

The purpose of this is to calculate and display the result in an EFIS below a display showing wind speed and direction.

One other thing I might mention is that I see the difference between the mag heading and the true heading of the winds seems to be about 19 degrees and not the mag var for the location. for example at KONT the magvar is shown as 12.4 but actual is approx 14 degrees.
I would appreciate any advice that can be given. Thanks in advance.

Richie1935
 
sin(0.5236) is 0.5000, not 0.009136.

The sin function you are using expects its argument in degrees not radians.
 
sin(0.5236) is 0.5000, not 0.009136.

The sin function you are using expects its argument in degrees not radians.

Hi MGH,
I agree with what you have stated except the SDK states that inorder to use the sin or cos funtion it must be in radians not degrees. Believe you me I have tried to use every combination possible but using anything but radials the solution is a flat 0 and will not change with any input changes. Right now I am at a complete loss.
I quote from my original post "As usual, unless you have a version of sin and cos available that takes degree arguments, you'll need to convert to radians."
Are there any other suggestions, please.

Richie
 
The SDK is wrong in more places than I can count...
Hi Tom,
You are right in your statement. There has to be a way to use the formula with degrees in reference to sin or cos but I have tried using every combination I thought of but to no avail so this maybe a lost cause and it may not be solveable. At least I can say is thanks for your time and thoughts.

Richie
 
Are you coding in XML or C?
If you're in XML, just use the proper A or L variable with radians as units and then apply the sin or cos operator, for example

(A:Var, radians) sin

If you're in C++, to simplify you can get the proper value using the execute_calculator_code function.

Tom
 
The FSX XML sin function does take its argument in radians.

0.5236 sin (>L:Var1,number)

assigns sin(0.5236) to L:Var1

and <GaugeString>%( (L:Var1, number) )%!05f!</GaugeString>

displays L:Var1 as 0.500001

in C/C++ trig functions (sin etc) always take radians as the argument.
 
The FSX XML sin function does take its argument in radians.

0.5236 sin (&gt;L:Var1,number)

assigns sin(0.5236) to L:Var1

and <GaugeString>%( (L:Var1, number) )%!05f!</GaugeString>

displays L:Var1 as 0.500001

in C/C++ trig functions (sin etc) always take radians as the argument.

Hi mgh,
I havd been working on the problem and it looks like it is solved. I have a custom gauge that reads the perimeters and then I can see what is happening.

Code:
X Wind = %((A:AMBIENT WIND DIRECTION,radians) (A:PLANE HEADING DEGREES GYRO,radians) - sin (A:AMBIENT WIND VELOCITY,knots) * )%!3.0f! kts

This is the perameters I setup:(
Wind Direction = 72.8 deg Aircraft Heading = 46 deg Wind Speed = 20 Kts calculated to a cross wind of 9 kts. and verified on a hand calculator to be correct.
So I thank all of you for your efforts and advice and it is appreciated as always. The next step is to enter that code into the EFIS for display.
The winds in the top info display of FSX is that the winds given are in mag and the winds in the weather are in True. I find as I stated before that there is a difference of 19 degrees between the top display and ambient wind speed in weather.

Thanks again,
richie
 

Attachments

  • Cross Wind data.jpg
    Cross Wind data.jpg
    89 KB · Views: 634
Back
Top