xxxxxxxxxx
31
function drawEq(equation, step, minX, minY, maxX, maxY){
stroke(254,220,35)
beginShape(LINES)
for (let i = minX; i < maxX; i += float(step)){
vertex(i,equation(i));
vertex(i+1,equation(i+1));
}
endShape()
}
function EQ(x){
return x
}
function setup() {
createCanvas(400, 400);
translate(width/2,height/2)
background(51);
//scale(6,6)
rotate(-90*(PI/180))
drawEq(EQ, 0.1, -1000, 0, 1000)
stroke(255)
line(-width, 0, width, 0)
line(0, -height, 0, height)
}
function draw() {
}