xxxxxxxxxx
30
function fdraw() {
stroke(0, 0, 255);
ly = map(0, f(4.7), f(3), height / 6, 9*height / 10);
line(width / 10, ly, 9 * width / 10, ly);
uy = map(0.1, f(4.7), f(3), height / 6, 9*height / 10);
line(width / 10, ly, width / 10, height - uy);
stroke(255, 0, 105);
strokeWeight(5);
for (let i = pA; i <= pB; i += sigma) {
mx = map(i, 3, 6, width / 10, 9 * width / 10);
my = map(f(i), f(3), f(4.7), height / 6, 9*height / 10);
point(mx, my);
}
}
function f(x) {
return sin(x);
}
var pA = 3,
pB = 6;
var epsilon = 0.5;
var sigma = 0.1;
function setup() {
createCanvas(400, 400);
background(31);
fdraw();
}