JSFiddle - React, Tailwind, and code Playground

by electronoob

HTML

<canvas id=wee width=800 height=800></canvas>

JavaScript

//Logistic function - sigmoid
ctx = wee.getContext("2d");

function sigmoid(x) {
  var L = 1;
  var k = 3;
  var Xo = 0;
	return L/(1+Math.pow(Math.E,-k*(x-Xo)));
}

for (i=-6;i<6;i+=0.1) {
	ctx.fillRect(10*-i+100,sigmoid(i)*100 + 100,1,1);
}