tag:support.nodebox.net,2012-11-01:/discussions/show-your-work/630-gradual-change-nodeNodeBox: Discussion 2023-10-30T09:33:02Ztag:support.nodebox.net,2012-11-01:Comment/605797122023-10-30T01:25:18Z2023-10-30T09:33:02ZGradual Change Node<div><p>Attached is a new node, gradual, which creates a list of numbers that gradually change. Although it seems to be a math-centric node, most of its uses are for visual effects: interesting curves or realistic motions.</p>
<p>To control the rate of change you supply a range of percentage values (e.g. 90% to 130%). Gradual will generate the specified amount of random change values within that range and apply them to a starting value and then to each successive product. So if you start at 100 and asked for six values changing at a rate between 90% and 130%, you might get 100, 127, 116, 119, 149, 159.</p>
<p>The first value, v0, is always your start value. Then next, v1 = v0 * r0, the next, v2 = v1 * r1, etc. where r0, r1, ... are random percentages in the specified range. Because these are successive products, the values will compound. If you set both min and max percentage to 105%, you would get a steady compound interest curve at 5% - an exponential curve. If you set a min percentage less than 100% and max greater than 100% you will get random fluctuations, up or down, with an overall positive or negative trend depending on the range.</p>
<p>Gradual takes five parameters:</p>
<ul>
<li><strong>Amount:</strong> The number of values</li>
<li><strong>Start:</strong> The starting value</li>
<li><strong>Min percent:</strong> The lower end of the range of random change</li>
<li><strong>Max percent:</strong> The upper end of the range of random change</li>
<li><strong>Seed:</strong> The seed value for the random number generator</li>
</ul>
<p>A list of values that change in this way has many uses. The demo (attached - see screenshot) shows one obvious use: random sales charts that can be made to trend up or down. Here the gradual values are simply Y values in a line with X values supplied by a range node. Change the seed or the range to see how the line changes.</p>
<p>The demo also contains a less obvious use case: using gradual to produce a varying rate of change in an animation. Here a lower case a is rotated at a random but steadily increasing rate. I used this trick in a recent animation to create a wrench tightening a nut in a realistic series of discrete steps, first slow as the nut initially resists, then faster as the inertia breaks and the momentum increases.</p>
<p>My hunch is that there are many surprising uses for this simple concept. I'm curious to see what you guys will do with this!</p>
<p>Graudual will appear in the next release of the Cartan Node Library.</p></div>john