Code Art 01122020

in hive-174578 •  5 years ago 

I went through old code and found a neat lerp algorithm. Two circles rotate and a third chases the previous angle between the two moving circles. The path of the third is drawn with very low (I believe it is 5) opacity.

image.png

image.png

image.png

image.png

image.png


let v1,v2,v3,v4;
var size=1;
var rot1=30/100;
var rot2=40/200;


function setup() {
createCanvas(windowWidth, windowHeight);
background(0);

noFill();
v1 = createVector(-20, 20);
v2 = createVector(20, 20);

}


function draw() {
var r = 0;
var g = 255;
var b = 100;

r+=5;

var step=.05;   

translate(width/2,height/2);

v1.rotate(rot1);
v2.rotate(rot2);
v3 = p5.Vector.lerp(v1, v2, step);

stroke((5*second())%255,(6*second())%255,(4*second())%255,5);
ellipse(v3.x,v3.y,size,size);
size+=.1;

}


function roll(n){
return floor(random(n));
}

https://www.openprocessing.org/user/168676#sketches

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

nice one keep doing on your great work :)