//Shipra Gupta //Feb 1, 2008 //Chapter Shape 1, Processing (B.Fry, C.Ray) //Excercise 1 --> create composition with one line and one ellipse //Excercise 2 --> modify above code to change fill, stroke and background //Excercise 3 --> create a visual knot with bezier curves only //SET STAGE size(780, 200); background(255); //---------------------------------------- //EX 1 ellipse(110, 150, 200, 50); line(110, 150, 110, 20); //---------------------------------------- //EX 2 //SUNLIGHT noStroke(); colorMode(RGB); for(float i = 0; i<200; i++){ stroke(255, 255, 0+i*1.4); line(350-i/1.5, 0+i, 550-i/1.5, 0+i); } //quad(325, 0, 525, 0, 425, 200, 225, 200); //GNOMON AND BASE fill(50, 255, 200); stroke(0); strokeWeight(1); ellipse(350, 150, 200, 50); stroke(255, 0, 0, 150); strokeWeight(10); strokeCap(ROUND); line(350, 150, 350, 20); stroke(0, 50); line(350, 150, 220, 210); //---------------------------------------- //EX 3 //BEZIER KNOT //illustration reference from //http://www.josleys.com/articles/ams_article/Lorenz3.htm stroke(200,0,200, 50); strokeWeight(10); noFill(); bezier(650, 60, 750, 70, 750, 200, 650, 160); bezier(650, 60, 550, 70, 550, 200, 650, 160); bezier(650, 30, 790, 50, 570, 130, 650, 160); bezier(650, 30, 510, 50, 730, 130, 650, 160);