• 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.

Equations to Script

Messages
137
Country
us-southcarolina
All,

I used EXCEL to create some equations based on some regression analysis of some <Nonlinearity> tables. If someone would be so kind to check my work to see if i wrote the scripts correctly. These are all being used for point placement so rounding to nearest whole pixel is added. @Distance is a macro that calcs the distance to touch down along the Glide slope. X=@Distance

Eq (1)
y = -3.382ln(x) + 38.442

Script
(-3.382 (@Distance) ln * 38.442 + .5 + int) (>L:X1, enum)

-------------------------
Eq (2)
Y= 15.39ln(x) - 93.075

Script
(15.39 (@Distance) ln * 93.075 - .5 + int ) (>L:VertOffset, emun)

-------------------------

Eq (3)

y = 322360x^-1.139

Script
(322360 (@Distance) * -1.139 pwr .5 + int ) (>L:X2, enum)

---------------------------

Eq (4)
y = 11187x^-0.622

Script
(11187 (@Distance) * -0.622 pwr .5 + int) (>L:Y2, enum)

-------------------------------
Script
0 (>L:Y1, enum) // Y1 should be = 0

Thanks

Joel
 
Last edited:
UPDATE
I think I miss read the equation. i believe it should be.....

Eq 3)
y = 322360x^-1.139

Script
(322360 (@Distance -1.139 pwr) * .5 + int ) (>L:X2, enum) ????

Eq 4)
y = 11187x^-0.622

Script
(11187 (@Distance -0.622 pwr) * .5 + int) (>L:Y2, enum)

????

Joel
 
Note that there can be no parenthesis in XML formatting (except for designating variables).

And rounding to the nearest whole number is best achieved with "ceil" instead of "int".
 
Note that there can be no parenthesis in XML formatting (except for designating variables).

And rounding to the nearest whole number is best achieved with "ceil" instead of "int".

First I replaced @Distance with L:distance which is evaluated earlier in the code. I looked at the FSX SDK and it says the "Ceil" rounds up, and Int rounds down. So I guess to use "Ceil" to round it would be " .5 - ceil " ? What about "near" does that work in FS9 ? The SDK says "near" rounds without having to +-.5 ??

So after removing () with these. do they look valid ?

1) -3.382 (L:distance, feet) ln * 38.442 + near (>L:X1, enum) OR
(L:distance, feet) ln -3.382 * 38.442 + near (>L:X1, enum)

2) 15.39 (L:distance, feet) ln * 93.075 - near (>L:VertOffset, emun) OR
(L:distance, feet) ln 15.39 * 93.075 - near (>L:VertOffset, emun)

3) 322360 (L:distance, feet) -1.139 pwr * near (>L:X2, enum) OR
(L:distance, feet) -1.139 pwr 322360 * near (>L:X2, enum)

4) 11187 (L:distance, feet) -0.622 pwr * near (>L:Y2, enum) OR
(L:distance, feet) -0.622 pwr 11187 * near (>L:Y2, enum)

thanks
Joel
 
Last edited:
Back
Top