Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
judithstrich
judithstrich's Profile
1
Posts
1
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Need urgently help - sinus fluctuations
[3 Replies]
27-Nov-2012 03:21 AM
Forum:
Programming Questions
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
«Prev
Next »
Moderate user : judithstrich
Forum