### Learning Math and Coding with Robots

 Grid: Tics Lines: Width px Hash Lines: Width px Labels: Font px Trace Lines: Robot 1: Width px Robot 2: Width px Robot 3: Width px Robot 4: Width px
 Axes: x-axis y-axis Show Grid Grid: 24x24 inches 36x36 inches 72x72 inches 96x96 inches 192x192 inches Quad: 4 quadrants 1 quadrant Hardware Units: US Customary Metric
 Background:

#### Robot 1

 Initial Position: ( in, in) Initial Angle: deg Current Position: (0 in, 0 in) Current Angle: 90 deg Wheel Radius: 1.75 in1.625 in2.0 in Track Width: in

#### Robot 2

 Initial Position: ( in, in) Initial Angle: deg Current Position: (6 in, 0 in) Current Angle: 90 deg Wheel Radius: 1.75 in1.625 in2.0 in Track Width: in

#### Robot 3

 Initial Position: ( in, in) Initial Angle: deg Current Position: (12 in, 0 in) Current Angle: 90 deg Wheel Radius: 1.75 in1.625 in2.0 in Track Width: in

#### Robot 4

 Initial Position: ( in, in) Initial Angle: deg Current Position: (18 in, 0 in) Current Angle: 90 deg Wheel Radius: 1.75 in1.625 in2.0 in Track Width: in

Draw an Umbrella from Above
Problem Statement:
The pre-placed blocks draw a funny looking umbrella. Fix the x and y variables in the loop and the count block so that the umbrella created has 8 vertices and 8 sides of equal size, as shown in the initial prompt. You will need to change the values inside the cos and sin functions, and the number of times the program loops. You also need to add 25 raindrops in random locations. Do this using a loop.
/* Code generated by RoboBlockly v2.0 */
#include <chplot.h>
double i;
double x;
double y;
double j;
double xRan;
double yRan;
CPlot plot;

plot.backgroundColor("#ccffff");
plot.noStrokeColor();
plot.fillColor("red");
plot.circle(18, 18, 10);
plot.fillColor("#ccffff");
for(i = 1; i <= 8; i++) {
x = 18 + 18 * cos(deg2rad((45 * i)));
y = 18 + 18 * sin(deg2rad((45 * i)));
plot.circle(x, y, 10);
}
plot.strokeColor("black");
plot.point(18, 18);
plot.fillColor("#3366ff");
plot.strokeColor("#3366ff");
plot.strokeWidth(1);
for(j = 1; j <= 25; j++) {
xRan = randint(1, 35);
yRan = randint(1, 35);
plot.circle(xRan, yRan, 0.4);
plot.regularPolygon(xRan, yRan + 0.4, 3, 0.4, 0);
}
plot.grid(PLOT_OFF);

plot.axisRange(PLOT_AXIS_XY, 0, 36);
plot.ticsRange(PLOT_AXIS_XY, 6);
plot.sizeRatio(1);
plot.plotting();
/* Code generated by RoboBlockly v2.0 */
#include <chplot.h>
double i;
double x;
double y;
double j;
double xRan;
double yRan;
CPlot plot;

plot.backgroundColor("#ccffff");
plot.noStrokeColor();
plot.fillColor("red");
plot.circle(18, 18, 10);
plot.fillColor("#ccffff");
for(i = 1; i <= 8; i++) {
x = 18 + 18 * cos(deg2rad((45 * i)));
y = 18 + 18 * sin(deg2rad((45 * i)));
plot.circle(x, y, 10);
}
plot.strokeColor("black");
plot.point(18, 18);
plot.fillColor("#3366ff");
plot.strokeColor("#3366ff");
plot.strokeWidth(1);
for(j = 1; j <= 25; j++) {
xRan = randint(1, 35);
yRan = randint(1, 35);
plot.circle(xRan, yRan, 0.4);
plot.triangle(xRan + 0.4, yRan, xRan - 0.4, yRan, xRan, yRan + 0.7);
}
plot.grid(PLOT_OFF);

plot.axisRange(PLOT_AXIS_XY, 0, 36);
plot.ticsRange(PLOT_AXIS_XY, 6);
plot.sizeRatio(1);
plot.plotting();
 Blocks Save Blocks Load Blocks Show Ch Save Ch Workspace
Problem Statement:
The pre-placed blocks draw a funny looking umbrella. Fix the x and y variables in the loop and the count block so that the umbrella created has 8 vertices and 8 sides of equal size, as shown in the initial prompt. You will need to change the values inside the cos and sin functions, and the number of times the program loops. You also need to add 25 raindrops in random locations. Do this using a loop.

Time