String from array to float
in
Programming Questions
•
10 months ago
Even after searching and reading through the forums, I can't get my head around how to make this work. Here's some of my code.
- String[] pulses = { "sin(t)", "cos(t)" };
- void setup() {
- size(500, 500);
- }
- void draw() {
- float t = millis() * 0.15;
- float sizeChange = …
- ellipse(0, 0, sizeChange, sizeChange)
- }
Now, the problem is that nothing seems to work on line 9. What I want is to be able to take some index from the array “pulses” and use it to be the “sizeChange”, but stuff like
- float sizeChange = float(pulses[1]);
It seems like it should be simple, but I'm not getting it to work.
Thank you in advance
1