## Jupyter at Bryn Mawr College

Public notebooks: /services/public/dblank / CS110 Intro to Computing / 2015-Fall / Notes
In [3]:
fill(255, 0, 128);
beginShape();
vertex(10, 10);
vertex(70, 10);
vertex(80, 80);
vertex(40, 80);
vertex(5, 50);
vertex(10, 10);
endShape();

Sketch #3:

In [14]:
void setup() {
size(500, 500);
fill(0);
ellipse(width/2, height/2, 5, 5);
println("----------------------------------");
}

float last_x = 0;
float last_y = 0;

void mouseDragged() {
if (mouseX != last_x && mouseY != last_y) {
println("vertex(" + int(mouseX - width/2) + " + x, "
+ int(mouseY - height/2) + " + y);");
rect(mouseX, mouseY, 5, 5);
last_x = mouseX;
last_y = mouseY;
}
}

Sketch #13:

In [27]:
void setup() {
size(500, 500);
}

float angle1 = 0;

void draw() {
background(255);
for (int i=0; i <5; i++) {
for (int j=0; j < 5; j++) {
drawPerson(i * 100, j * 100, angle1);
}
}
angle1 += PI/180 * 5;
}

void drawPerson(float x1, float y1, float angle) {
pushMatrix();
translate(x1, y1);
rotate(angle);
scale(.5);
fill(128, 0, 56);
beginShape();
float x = 0;
float y = 0;
vertex(-30 + x, -38.111092331968166 + y);
vertex(-29 + x, -35.111092331968166 + y);
vertex(-28 + x, -32.111092331968166 + y);
vertex(-26 + x, -31.111092331968166 + y);
vertex(-25 + x, -30.111092331968166 + y);
vertex(-23 + x, -29.111092331968166 + y);
vertex(-21 + x, -28.111092331968166 + y);
vertex(-19 + x, -27.111092331968166 + y);
vertex(-15 + x, -26.111092331968166 + y);
vertex(-11 + x, -25.111092331968166 + y);
vertex(-9 + x, -23.111092331968166 + y);
vertex(-3 + x, -22.111092331968166 + y);
vertex(-1 + x, -21.111092331968166 + y);
vertex(8 + x, -22.111092331968166 + y);
vertex(11 + x, -23.111092331968166 + y);
vertex(12 + x, -25.111092331968166 + y);
vertex(18 + x, -26.111092331968166 + y);
vertex(20 + x, -27.111092331968166 + y);
vertex(22 + x, -28.111092331968166 + y);
vertex(25 + x, -30.111092331968166 + y);
vertex(26 + x, -31.111092331968166 + y);
vertex(27 + x, -32.111092331968166 + y);
vertex(29 + x, -33.111092331968166 + y);
vertex(30 + x, -35.111092331968166 + y);
vertex(31 + x, -38.111092331968166 + y);
vertex(32 + x, -39.111092331968166 + y);
vertex(34 + x, -40.111092331968166 + y);
vertex(35 + x, -39.111092331968166 + y);
vertex(58 + x, -38.111092331968166 + y);
vertex(59 + x, -37.111092331968166 + y);
vertex(65 + x, -36.111092331968166 + y);
vertex(68 + x, -35.111092331968166 + y);
vertex(70 + x, -33.111092331968166 + y);
vertex(72 + x, -32.111092331968166 + y);
vertex(74 + x, -30.111092331968166 + y);
vertex(77 + x, -29.111092331968166 + y);
vertex(78 + x, -28.111092331968166 + y);
vertex(80 + x, -26.111092331968166 + y);
vertex(82 + x, -25.111092331968166 + y);
vertex(84 + x, -23.111092331968166 + y);
vertex(86 + x, -22.111092331968166 + y);
vertex(87 + x, -21.111092331968166 + y);
vertex(88 + x, -20.111092331968166 + y);
vertex(89 + x, -19.111092331968166 + y);
vertex(91 + x, -18.111092331968166 + y);
vertex(94 + x, -17.111092331968166 + y);
vertex(96 + x, -15.111092331968166 + y);
vertex(97 + x, -12.111092331968166 + y);
vertex(98 + x, -11.111092331968166 + y);
vertex(100 + x, -10.111092331968166 + y);
vertex(101 + x, -9.111092331968166 + y);
vertex(98 + x, -8.111092331968166 + y);
vertex(97 + x, -7.111092331968166 + y);
vertex(96 + x, -6.111092331968166 + y);
vertex(94 + x, -5.111092331968166 + y);
vertex(91 + x, -3.111092331968166 + y);
vertex(89 + x, -2.111092331968166 + y);
vertex(88 + x, -1.111092331968166 + y);
vertex(85 + x, 0.888907668031834 + y);
vertex(82 + x, 2.888907668031834 + y);
vertex(80 + x, 3.888907668031834 + y);
vertex(77 + x, 2.888907668031834 + y);
vertex(75 + x, 1.888907668031834 + y);
vertex(70 + x, 0.888907668031834 + y);
vertex(66 + x, -0.11109233196816604 + y);
vertex(64 + x, -1.111092331968166 + y);
vertex(60 + x, -2.111092331968166 + y);
vertex(58 + x, -3.111092331968166 + y);
vertex(57 + x, -5.111092331968166 + y);
vertex(55 + x, -6.111092331968166 + y);
vertex(54 + x, -7.111092331968166 + y);
vertex(51 + x, -9.111092331968166 + y);
vertex(50 + x, -10.111092331968166 + y);
vertex(49 + x, -3.111092331968166 + y);
vertex(48 + x, -2.111092331968166 + y);
vertex(47 + x, -1.111092331968166 + y);
vertex(46 + x, 0.888907668031834 + y);
vertex(45 + x, 1.888907668031834 + y);
vertex(44 + x, 3.888907668031834 + y);
vertex(42 + x, 8.888907668031834 + y);
vertex(41 + x, 12.888907668031834 + y);
vertex(40 + x, 18.888907668031834 + y);
vertex(39 + x, 22.888907668031834 + y);
vertex(38 + x, 27.888907668031834 + y);
vertex(37 + x, 31.888907668031834 + y);
vertex(36 + x, 36.888907668031834 + y);
vertex(35 + x, 39.888907668031834 + y);
vertex(34 + x, 41.888907668031834 + y);
vertex(32 + x, 40.888907668031834 + y);
vertex(-11 + x, 41.888907668031834 + y);
vertex(-13 + x, 42.888907668031834 + y);
vertex(-15 + x, 41.888907668031834 + y);
vertex(-14 + x, 40.888907668031834 + y);
vertex(-13 + x, 38.888907668031834 + y);
vertex(-14 + x, 20.888907668031834 + y);
vertex(-15 + x, 18.888907668031834 + y);
vertex(-18 + x, 13.888907668031834 + y);
vertex(-19 + x, 10.888907668031834 + y);
vertex(-20 + x, 7.888907668031834 + y);
vertex(-21 + x, 6.888907668031834 + y);
vertex(-22 + x, 4.888907668031834 + y);
vertex(-23 + x, 2.888907668031834 + y);
vertex(-24 + x, 1.888907668031834 + y);
vertex(-25 + x, -0.11109233196816604 + y);
vertex(-26 + x, -2.111092331968166 + y);
vertex(-28 + x, -3.111092331968166 + y);
vertex(-29 + x, -5.111092331968166 + y);
vertex(-30 + x, -6.111092331968166 + y);
vertex(-31 + x, -7.111092331968166 + y);
vertex(-32 + x, -6.111092331968166 + y);
vertex(-33 + x, -3.111092331968166 + y);
vertex(-34 + x, -2.111092331968166 + y);
vertex(-36 + x, -1.111092331968166 + y);
vertex(-38 + x, -0.11109233196816604 + y);
vertex(-39 + x, 0.888907668031834 + y);
vertex(-44 + x, 3.888907668031834 + y);
vertex(-48 + x, 4.888907668031834 + y);
vertex(-51 + x, 7.888907668031834 + y);
vertex(-52 + x, 9.888907668031834 + y);
vertex(-53 + x, 11.888907668031834 + y);
vertex(-55 + x, 12.888907668031834 + y);
vertex(-56 + x, 9.888907668031834 + y);
vertex(-58 + x, 7.888907668031834 + y);
vertex(-59 + x, 4.888907668031834 + y);
vertex(-60 + x, 3.888907668031834 + y);
vertex(-63 + x, 1.888907668031834 + y);
vertex(-65 + x, -0.11109233196816604 + y);
vertex(-68 + x, -2.111092331968166 + y);
vertex(-69 + x, -5.111092331968166 + y);
vertex(-70 + x, -6.111092331968166 + y);
vertex(-72 + x, -7.111092331968166 + y);
vertex(-73 + x, -9.111092331968166 + y);
vertex(-74 + x, -10.111092331968166 + y);
vertex(-75 + x, -11.111092331968166 + y);
vertex(-76 + x, -12.111092331968166 + y);
vertex(-75 + x, -13.111092331968166 + y);
vertex(-74 + x, -17.111092331968166 + y);
vertex(-73 + x, -19.111092331968166 + y);
vertex(-72 + x, -20.111092331968166 + y);
vertex(-71 + x, -22.111092331968166 + y);
vertex(-69 + x, -23.111092331968166 + y);
vertex(-68 + x, -25.111092331968166 + y);
vertex(-65 + x, -27.111092331968166 + y);
vertex(-63 + x, -28.111092331968166 + y);
vertex(-61 + x, -29.111092331968166 + y);
vertex(-59 + x, -32.111092331968166 + y);
vertex(-58 + x, -33.111092331968166 + y);
vertex(-56 + x, -35.111092331968166 + y);
vertex(-55 + x, -37.111092331968166 + y);
vertex(-54 + x, -38.111092331968166 + y);
vertex(-53 + x, -37.111092331968166 + y);
vertex(-48 + x, -38.111092331968166 + y);
vertex(-46 + x, -39.111092331968166 + y);
vertex(-40 + x, -40.111092331968166 + y);
vertex(-31 + x, -39.111092331968166 + y);
vertex(-30 + x, -38.111092331968166 + y);
vertex(-26 + x, -37.111092331968166 + y);
endShape();
fill(0);
beginShape();
// paste pants here!
endShape();
popMatrix();
}

Sketch #24: