/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://studio.sketchpad.cc/sp/pad/view/ro.ix23moh-T9T/rev.1150
*
* authors:
* Tanya Tasheva
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
/* "Oscillations" were the first graphics made on an analog computer. For many years, they represented the most advanced acheivements of what was known as computer art. His oscillations are photographs of electronic wave forms displayed on a cathode-ray tube. */
static final int NUM_LINES=15;
Lines m;
Liness n;
void setup() {
background(13);
size(500, 500);
m = new Lines(48,222);
n= new Liness(23,250);
}
void draw() {
background(13);
stroke(255,55,80,150);
m.display();
stroke(250,55,250,233);
n.dd();}
class Lines{
float t;
float x1;
float y1;
float x2;
float y2;
Lines(){
strokeWeight(3);
}
void display(){
translate(width/2, height/2);
for(int i=0; i<NUM_LINES;i++){
line(-x1(t+i), -y1(t+i), -x2(t+i),-y2(t+i));
}
t+=0.5;
}
float x1(float t) {
return sin(t/5)* 66 + sin(t/5)*20;
}
float y1(float t) {
return cos(t/10) * 100+ sin(t/5)*30;
}
float x2(float t) {
return sin(t/10)* 200 + sin(t)*3+cos(t)*10;
}
float y2(float t) {
return cos(t/20) * 200 + cos(t/8)*20;
}
}
class Liness{
float h;
float a1;
float b1;
float a2;
float b2;
Liness(){
strokeWeight(3);
}
void dd(){
// translate(width/-2, height/-2);
for(int i=0; i<NUM_LINES;i++){
line(a1(h+i), b1(h+i), a2(h+i),b2(h+i));
}
h+=0.5;
}
float a1(float h) {
return sin(h/5)* 66 + sin(h/5)*20;
}
float b1(float h) {
return cos(h/10) * 100+ sin(h/5)*30;
}
float a2(float h) {
return sin(h/10)* 200 + sin(h)*3+cos(h)*10;
}
float b2(float h) {
return cos(h/20) * 200 + cos(h/8)*20;
}
}