Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.






                var cnt =-12;//x-value and counter for each polynomial
var a=0.01,t=0;//initial values for coefficients, and reset counter t
function setup() {
  createCanvas(400, 400); //create the canvas
  background(20); //black background
  strokeWeight(0.1);//thin lines

function draw() {
  translate(width/2,width/2) //translate the canvas for (0,0)middle
    fill(200, 250-10*t, 250,40)//gradient fill
    x1 = cnt; //set x to counter
    y1 = a*pow((x1),3)//Polynomial y value ax^3+bx^2+cx
    if(y1>-200 && y1 <200){ //only draw circles if it is on the canvas
      circle(x1*15,y1,cnt*3)//draw a circle for a point on the polynomial
    cnt=cnt+0.3; //increase counter for x
    if (cnt>12){//draw the next polynomial
      newCoeff();// function to change coefficients
function newCoeff(){
  a = a*1.5//change a
  cnt = -12;//reset cnt
  t = t+1; //increment screen reset counter
  if (t> 20){ 
    //background(0);//reset canvas
    //t=0,k = 0, p = 1,h = 0;//initialize variables
    noLoop()//stops when done - uncomment previous two lines to loop and comment this one