x=
y=

Parametric Equations

Parametric equations is a vital part of mathematics.
Parametric equations are equations in the form of $$x=f(t)$$$$y=g(t)$$
Where t is the changing parameter and f(t) and g(t) are the functions.
They are often used to describe the motion of moving objects and Parametric equations are also very important in Computer Graphics, Computer Aided Design (CAD).

Code

            
    elem=document.querySelector(".example-container");
    setCanvas(elem);
    
    
    function draw(){
        clearCanvas();
        points=[];
        new line(WIDTH/2,0,WIDTH/2,HEIGHT,'#fff',0.5);
        new line(0,HEIGHT/2,WIDTH,HEIGHT/2,'#fff',0.5);

        for(t=0;t<=360;t++){
            x=eval(document.getElementById("inpfuncx").value);
            y=eval(document.getElementById("inpfuncy").value);
            points.push([WIDTH/2+x,HEIGHT/2-y]);
        }

        new polygon(points,'#695fe6',0,'#695fe6',2,false);
        
    }
    
    draw();

    // use draw() as onchange event for input box.