Search the Community
Showing results for tags 'math'.
Found 2 results
-
math Match numbers place increase
NumbNutsJunior posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
What I am trying to do probably makes no sense, and I really have no idea what i'm doing in this place of algebra but here is my problem ... I am trying to populate a list of values from min (x) to max (y) increasing the values by the step amount (z) easy enough, but I want to have the step value increase in size as the numbers get larger and larger so I don't have a list the size 'max / step', if max is say 5000000. So once the current value reaches another place the step value matches in increase by the same amount: min(0); max(5000000); starting step(2500); + 2500 +25000 +250000 Expected output: [0, 2500, 5000, 7500, 10000, 25000, 50000, 75000, 100000, 125000, ... , 975000, 1000000, 1250000, ... ] Below is probably just a bunch of junk, so maybe cover your eyes from this part, as It likely will lead you no where but I would not really know ... // Limits _min_value = 0; _max_value = 5000000; // Init _values = []; _current_value = _min_value; // Init loop variables _value_step = 2500; _step_power = floor(log _value_step); _base_step = _value_step / (10 ^ _step_power); // Populate values while {_current_value <= _max_value} do { // Push to value list _values pushBack _current_value; // Figure step amount _current_value_power = floor(log _current_value); _value_step = _base_step * (10 ^ _current_value_power); _powers_difference = _current_value_power - _step_power; // ... // Update current value _current_value = _current_value + _value_step; }; I figured this fell into the category of logarithms but I am apparently not very good at learning and using them as I have been stuck on trying to complete this problem all day. Please help 🙂 Note: I would like to figure this problem without a bunch of 'if' or 'switch' statements, just good old reliable math -
Help needed to get in a script curve-like increase, not linear one.
NightIntruder posted a topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
I need help with specific problem I am working on together with Alex. What we need to achieve basically is weight changes of an aircraft relative to ambient temperature. At the moment the mass raise is linear. I would like to make it like this curve, below: (on the scheme, the first row is ambient temperature of Celsius in 5 degree increament, while the second row is additional weight in LBs). Please, note that the increase is started above 5 deg of C, but for simplicity it can start from 0. Is there any chance for light code that can be a part of a script (that runs very often) and does the math to get such a curve of increase? I guess it might be a factor as a variable that rises along with the ambient temperature. Then the temperature have to be multiplied by the factor to get the rise in weight. At the moment, the constant factor (to get linear increase) is app. 182 lbs for every degree of Celsius.