void setup() {
// caleb b
// drawing a robot
int winWidth = 640;
int winHeight = 480;
size(640, 480);
fill(20, 20, 255); // set the colour to dark blue
int headWidth = 120;
int headHeight = 50;
rect((winWidth / 2) - (headWidth / 2), 10, headWidth, headHeight); // Robot Head
// Robot body
int bodyWidth = 70;
int bodyHeight = 150;
// Robot Arms
fill(194, 255, 253); // set colour to light blue
int armsWidth = (int) (3.5 * bodyWidth);
int armsHeight = 10;
rect((winWidth / 2) - (armsWidth / 2), headHeight + 30, armsWidth, armsHeight);
fill(235, 107, 52); // set colour to orange
rect((winWidth / 2) - (bodyWidth / 2), headHeight + 10, bodyWidth, bodyHeight); // Draw Robot Body (so that it goes over the arms)
// Robot Feet
fill(100, 100, 100);
int footHeight = 50;
int footWidth = 20;
rect((winWidth / 2) - (bodyWidth / 2) + 10, (headHeight + 10) + bodyHeight, footWidth, footHeight); // draw left foot
rect((winWidth / 2) - (bodyWidth / 2) + 40, (headHeight + 10) + bodyHeight, footWidth, footHeight); // draw right foot
// Robot facial features
fill(255,255,255);
int eyeWidth = 24;
int eyeHeight = 10;
rect((winWidth / 2) - (headWidth / 2) + 20, 25, eyeWidth, eyeHeight); // left eye
rect((winWidth / 2) - (headWidth / 2) + 70, 25, eyeWidth, eyeHeight); // right eye
rect((winWidth / 2) - (headWidth / 2) + 35, 45, eyeWidth * 2, eyeHeight); // mouth
}
void setup() {
// caleb b
// graphing a function
size(500, 500);
fill(0, 0, 0);
for (int x = 0; x < 500; x++) {
double y = -((3 * Math.pow(x, 3)) / 87500) + ((58 * Math.pow(x, 2)) / 2625) - ((302 * x) / 105) + 200;
rect(x, (float) (500 - y), 5, 6);
}
}