Need urgently help - sinus fluctuations
in
Programming Questions
•
10 months ago
Hi everybody,
i'm working on my bachelorthesis, in which i'm working with lissajous-figures an I'm a beginner in programming.
Here my problem:
Some strange things seem to happen to my figures when i run the sketch: the frequency ratio changes suddenly.
I want to draw different kinds of frequency ratios, but the have to be constant until i want to change them.
Can somebody help me?
Here is the code:
float x = 0;
float y = 0;
float a = 8;
float b = 2;
float ar = 0;
void setup() {
size(500,400);
background(0);
frameRate(25);
smooth();
}
void draw(){
background(0);
translate(250, 200);
noFill();
stroke(50);
for(int i=0;i<2000;i=i+1){
x = x + sin(a)*1;
y = y + sin(b)*1;
stroke(255);
strokeWeight(1);
point(x,y);
a=a+0.01;
b=b+0.025;
}
}
Thank you!
Judith
1