Chernoff faces

Chernoff faces are used by computer programmers to present online data or to show your feelings. You will used it to connect to air pollution data and change the face features according to the pollution level. Click to show code to find how to create a Javascript function to draw emojis and how to change their arguments or parameters. It is also shown a map function to change properties (e.g. background color) depending on the mouse position. Change the emoji function to a Chernoff face function taking into account the parameters used to define Chernoff faces.

show code

var c1,c2;
function setup(){
createCanvas (1980, 1080);
}
function emoji(x,y,w,h,eyeSize, mouthSize, a1,a2,ec1,ec2,ec3,mc1,mc2,mc3){
noStroke();
ellipse (x,y,w,h);//face
fill (ec1,ec2,ec3);//eye rgb colour
ellipse (x-w/5, y-h/5,eyeSize,eyeSize);//eye
ellipse (x+w/5, y-h/5,eyeSize,eyeSize);
fill (mc1,mc2,mc3);//mouth rgb colour
arc(x,y+h/4,mouthSize*3, mouthSize,a1,a2,CHORD);//mouth a=angle
}
function draw(){
background(c1,c2,c1);
fill (255,255,0); //yellow
emoji(200,200,150,150,25,25,0,PI,0,0,255,255,0,0);
fill(0,255,255);
emoji(400,200,150,150,25,25,PI,0,255,0,255,40,100,0);
c1=map(mouseX,0,width,0,255);
c2=map(mouseY, 0,height,255,0)
}

The best way to predict the future is to invent it (Alan Kay)