/* 15-100 D Homework #2 Dae Hong Kim daek@andrew.cmu.edu */ void setup(){ size(750, 250); smooth(); println("Homework #2"); println("Printing the initials: DHK"); background(140, 210, 180); //float x = 30; //x coordinate //float y = 10 ; // y coordinate //float thetaWidth = 200 ; // width of the figure //float thetaHeight = 200 ; // height of the figure } void draw(){ float x = 30; //x coordinate float y = 10 ; // y coordinate float thetaWidth = 200 ; // width of the figure float thetaHeight = 200 ; // height of the figure stroke(255, 120, 19); strokeWeight(5); noFill(); // Draw Initial D beginShape(); curveVertex(x, y); curveVertex(x + thetaWidth * 2/10, y); curveVertex(x + thetaWidth * 4/10, y + thetaHeight * 2/10); curveVertex(x, y + thetaHeight * 6/10); curveVertex(x + thetaWidth * 3/10, y + thetaHeight); curveVertex(x + thetaWidth * 3/10, y + thetaHeight); endShape(); beginShape(); curveVertex(x, y); curveVertex(x , y + thetaHeight * 2/10 ); curveVertex(x + thetaWidth * 6/10, y + thetaHeight * 1/10); curveVertex(x + thetaWidth * 8/10, y + thetaHeight * 3/10); curveVertex(x + thetaWidth * 9/10, y + thetaHeight * 5/10); curveVertex(x + thetaWidth * 8/10, y + thetaHeight * 7/10); curveVertex(x + thetaWidth * 4/10 , y + thetaHeight * 8/10); curveVertex(x , y + thetaHeight * 8/10 ); curveVertex(x , y + thetaHeight * 8/10 ); endShape(); // Draw initial H x += thetaWidth; stroke(23,138, 44); beginShape(); curveVertex(x, y); curveVertex(x, y); curveVertex(x + thetaWidth * 3/10, y + thetaHeight * 2/10); curveVertex(x + thetaWidth * 2/10 , y + thetaHeight * 5/10 ); curveVertex(x + thetaWidth * 3/10, y + thetaHeight * 8/10); curveVertex(x + thetaWidth * 1/10, y + thetaHeight); curveVertex(x + thetaWidth * 1/10, y + thetaHeight); endShape(); beginShape(); curveVertex(x + thetaWidth * 9/10, y); curveVertex(x + thetaWidth * 9/10, y); curveVertex(x + thetaWidth * 7/10, y + thetaHeight * 4/10); curveVertex(x + thetaWidth * 7/10, y + thetaHeight * 7/10); curveVertex(x + thetaWidth * 8/10, y + thetaHeight); curveVertex(x + thetaWidth * 8/10, y + thetaHeight); endShape(); beginShape(); curveVertex(x, y + thetaHeight * 6/10); curveVertex(x, y + thetaHeight * 6/10); curveVertex(x + thetaWidth * 2/10, y + thetaHeight * 5/10); curveVertex(x + thetaWidth * 4/10, y + thetaHeight * 6/10); curveVertex(x + thetaWidth * 6/10, y + thetaHeight * 5/10); curveVertex(x + thetaWidth * 8/10, y + thetaHeight * 6/10); curveVertex(x + thetaWidth * 8/10, y + thetaHeight * 6/10); endShape(); //Draw initial K x += thetaWidth; stroke(32, 54, 189); beginShape(); curveVertex(x, y); curveVertex(x + thetaWidth * 2/10, y + thetaHeight * 2/10); curveVertex(x + thetaWidth * 3/10, y + thetaHeight * 3/10); curveVertex(x + thetaWidth * 2/10, y + thetaHeight * 5/10); curveVertex(x, y + thetaHeight * 4/10); curveVertex(x + thetaWidth * 1/10, y + thetaHeight * 1/10); curveVertex(x + thetaWidth * 3/10, y); curveVertex(x + thetaWidth * 5/10, y + thetaHeight * 2/10); curveVertex(x + thetaWidth * 5/10, y + thetaHeight * 6/10); curveVertex(x + thetaWidth * 3/10, y + thetaHeight * 7/10); curveVertex(x, y + thetaHeight); curveVertex(x, y + thetaHeight * 8/10); curveVertex(x, y + thetaHeight * 8/10); endShape(); beginShape(); curveVertex(x + thetaWidth, y); curveVertex(x + thetaWidth, y); curveVertex(x + thetaWidth * 7/10, y + thetaHeight * 6/10); curveVertex(x + thetaWidth * 5/10, y + thetaHeight * 5/10); curveVertex(x + thetaWidth * 6/10, y + thetaHeight * 3/10); curveVertex(x + thetaWidth * 8/10, y + thetaHeight); curveVertex(x + thetaWidth, y + thetaHeight * 9/10); curveVertex(x + thetaWidth * 8/10, y + thetaHeight * 8/10); curveVertex(x + thetaWidth * 8/10, y + thetaHeight * 8/10); endShape(); }