[Processing] += operator, function equivalent?

AI Thread Summary
To graph the expression x += (100 - x) * 0.01, a function needs to be defined with time (t) as a parameter. The variable t can be incremented by a small value, delta_t, to represent time progression in the graph. The expression updates the variable x based on its current value, approaching 100 over time. This iterative process allows for the generation of a 2D graph where the x-axis represents time and the y-axis represents the value of x. The discussion emphasizes the importance of defining both time and the iterative update to visualize the behavior of x as it converges towards 100.
mishima
Messages
576
Reaction score
43
Hi, I was curious how I could turn any expression that looks like:

x += (100- x) * 0.01;

into a function that could be graphed.
 
Technology news on Phys.org
You need a second parameter, perhaps time (t) in order to generate a 2d graph.

t = ...
x = ...

...

t += delta_t;
x += (100- x) * 0.01;
 
Ah, of course...thanks.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top