|
@@ -97,7 +97,7 @@ Although the archive `tools.cpp` is not visible, there is an array called `mColo
|
97
|
97
|
|
98
|
98
|
## Laboratory Session:
|
99
|
99
|
|
100
|
|
-### Exercise 1: Implement the functions that operate the buttons for drawing lines
|
|
100
|
+### Exercise 1: Implement the Functions that Operate the Buttons for Drawing Lines
|
101
|
101
|
|
102
|
102
|
####Instructions
|
103
|
103
|
|
|
@@ -165,7 +165,7 @@ This function should work similarly as the `DiagonalLeft` function but produces
|
165
|
165
|
**Figure 5** - (a) A drawing with a white background and red dots. (b) When the user clicks on the right diagonal line button (`DiagonalRight`) and clicks the cell shown, (c) a right diagonal line that expands towards the top to the right and towards the bottom to the left of the cell clicked is drawn, until it finds a cell with a different color from the color of the background.
|
166
|
166
|
|
167
|
167
|
|
168
|
|
-### Exercise 2: Implement the functions that operate the buttons for drawing squares, triangles and circles.
|
|
168
|
+### Exercise 2: Implement the Functions that Operate the Buttons for Drawing Squares, Triangles and Circles.
|
169
|
169
|
|
170
|
170
|
Now, you will implement the functionality to draw squares, circles and triangles. The **size** of the figure drawn will depend on the size selected on sliding bar in the interface.
|
171
|
171
|
|
|
@@ -190,7 +190,7 @@ The triangle button produces an **isosceles** triangle as it is shown in Figure
|
190
|
190
|
|
191
|
191
|
**Figure 7** - Triangles of size 1 (green), 2 (red), 3 (blue), and 4 (yellow). In each case, the user clicked the center of the base of the triangle.
|
192
|
192
|
|
193
|
|
-#### 2c: Círculos
|
|
193
|
+#### 2c: Circles
|
194
|
194
|
|
195
|
195
|
Congratulations! You got to the most difficult part: circles! Here you’ll need to use your mathematical skills… we hope that you did well on your pre-calculus class...
|
196
|
196
|
|
|
@@ -199,7 +199,7 @@ Congratulations! You got to the most difficult part: circles! Here you’ll need
|
199
|
199
|
|
200
|
200
|
**Figure 8** - Circles of size 1 (green), 2 (red), 3 (blue), and 4 (yellow). In each case, the user clicked the center of the circle.
|
201
|
201
|
|
202
|
|
-**Help producing circles:**
|
|
202
|
+**Help Producing Circles:**
|
203
|
203
|
|
204
|
204
|
First of all, you need to understand that the terms associated with a circle that has an equation: $x^2+y^2=r^2$. For example, consider a circle with radius $r=1$. The equation $x^2+y^2=1$ tells us that every point $(x,y)$ that satisfies the equation is a point in the circle’s *circumference*. The expression for a *filled* circle is : $x^2 + y^2 <=r^2$. A filled circle, of radius $r=1$ has the expression $x^2 + y^2 <= 1$, which says that every point $(x,y)$ that satisfies $x^2 + y^2 <= 1$ is a point in a filled circle.
|
205
|
205
|
|
|
@@ -227,7 +227,7 @@ In this case, only the points that are shown below satisfy the expression $x^2
|
227
|
227
|
|
228
|
228
|
|
229
|
229
|
|
230
|
|
-### Exercise 3: Implement the function that fills the figures using recursion.
|
|
230
|
+### Exercise 3: Implement the Function that Fills the Figures using Recursion.
|
231
|
231
|
|
232
|
232
|
In this exercise you will implement the functionality to fill the color of the figures.One of the more convinient ways to express the algorithm to fill the figures is using recursion. A basic recursive algorithm (but it’s pretty weak) is found in Wikipedia:
|
233
|
233
|
|