Browse Source

README-en.md edited online with Bitbucket

Jose R Ortiz Ubarri 8 years ago
parent
commit
ccca9c7be3
1 changed files with 16 additions and 19 deletions
  1. 16
    19
      README-en.md

+ 16
- 19
README-en.md View File

203
 
203
 
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.
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
 
206
-¿Cómo producimos el círculo? Una manera sería generar todos los puntos **cercanos** al centro del círculo y determinar si éstos satisfacen la expresión $x^2 + y^2 <= r^2$. Por ejemplo, podemos tratar todos los puntos que están en el cuadrado de tamaño $2r+1$. Para un círculo de radio $r=2$ tendríamos que generar los siguientes puntos y probarlos en la expresión $x^2 + y^2 <=4$:
206
+How do we produce a circle? A way would be generating all of the *nearby* points to the center of the circle and determine if those satisfy the expression $x^2 + y^2 <= r^2$. For example, we can try all of the points that are in the square of size $2r+1$. For the circle of radius $r=2$ we would have to generate the following points and prove them in the expression $x^2 + y^2 <=4$:
207
 
207
 
208
 
208
 
209
 ````
209
 ````
214
 (-2,-2) (-1,-2) ( 0,-2) ( 1,-2) ( 2,-2)
214
 (-2,-2) (-1,-2) ( 0,-2) ( 1,-2) ( 2,-2)
215
 ```` 
215
 ```` 
216
 
216
 
217
-En este caso, solo los puntos que se muestran abajo satisfacen la expresión $x^2 + y^2 <=4$.
217
+In this case, only the points that are shown below satisfy the expression  $x^2 + y^2 <=4$.
218
 
218
 
219
 
219
 
220
 ````
220
 ````
227
 
227
 
228
 
228
 
229
 
229
 
230
-### Ejercicio 3: Implementar la función para rellenar figuras utilizando recursión.
230
+### Exercise 3: Implement the function that fills the figures using recursion. 
231
 
231
 
232
-En este ejercicio implementarás la funcionalidad para rellenar de color las figuras. Una de las maneras más convenientes para expresar el algoritmo para rellenar es utilizando recursión. Un algoritmo recursivo básico (pero bastante flojo) se encuentra en Wikipedia:
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 algortithm (but it’s pretty weak) is found in Wikipedia:
233
 
233
 
234
 
234
 
235
 ```
235
 ```
236
-Relleno (celda, color-buscado, color-reemplazo):
237
- 1. Si color-buscado es igual al color-reemplazo, return.
238
- 2. Si el color de celda no es igual al  color-buscado, return.
239
- 3. Ajusta el color de celda al color-reemplazo.
240
- 4. Ejecuta Relleno (un lugar a la izquerda de celda, color-buscado, color-reemplazo).
241
-    Ejecuta Relleno (un lugar a la derecha de celda, color-buscado, color-reemplazo).
242
-    Ejecuta Relleno (un lugar arriba de celda, color-buscado, color-reemplazo).
243
-    Ejecuta Relleno (un lugar abajo de celda, color-buscado, color-reemplazo).
236
+Flood Fill (cells, target-color, replacement-color):
237
+ 1. If target-color is the same to replacement-color, return.
238
+ 2. If the color of the cell is not the same as target-color, return. 
239
+ 3. Adjust the color of the cell to replacement-color.
240
+ 4. Execute Flood Fill (one step to the left of the cell, target-color, replacement-color).
241
+    Execute Flood Fill (one step to the right of the cell, target-color, replacement-color).    Execute Flood Fill (one step to the top of the cell, target-color, replacement-color).
242
+    Execute Flood Fill (one step to the bottom of the cell, target-color, replacement-color).
244
  5. Return.
243
  5. Return.
245
 
244
 
246
 ```
245
 ```
249
 
248
 
250
 
249
 
251
 
250
 
252
-**Figura 9** - (a) El dibujo original con trasfondo blanco y celdas negras. (b) Se selecciona una celda y se ejecuta el algoritmo de rellenar en esa celda (1), (c) La celda se pinta anaranjada, entonces (d) invoca `relleno` en la celda de la izquierda (2). (e) La celda 2 se pinta anaranjada, entonces  (f) invoca `relleno` en la celda de la izquierda  (3). Esta celda no es de color-buscado (es negra), la función regresa (returns). 
253
-(g) `relleno` se invoca en la celda de la derecha de la celda 2, pero esa celda ya está pintada del color-reemplazo. (h) `relleno` se invoca en la celda de arriba de la celda  2. (i) Esta celda se pinta anaranjada e (j) invoca `relleno` en la celda de la izquierda  (4). Esta celda no es de color-buscado, por lo tanto la función regresa (k), celda (3) invoca `relleno` en su celda derecha.
254
-
255
-Invoca la función relleno (`flood-fill`) y prueba su funcionamiento utilizando varias figuras. Asegúrate de probar figuras abiertas, como, por ejemplo, la siguiente:
251
+**Figure 9** - (a) The original drawing with a white background and black cells. (b) A cell is selected and the algorithm is executed to fill the cell (1), (c) The cell is painted orange, then (d) invokes `flood-fill` on the left cell (2). (e) The cell 2 is painted orange, then (f) invokes `flood-fill` on the cell of the left (3). This cell is not the target-color (its black), and the function returns. (g) `flood-fill` is invoked on the cell on the right of cell 2, but that cell is already painted with the replacement-color.  (h) `flood-fill` is invoked on the cell on top of the cell 2. (i) This cell is painted orange and (j) invokes `flood-fill` on the left cell  (4). This cell is not the target-color, therefore the function returns (k), cell (3) invokes `flood-fill` on its right cell. 
256
 
252
 
253
+The function `flood-fill` is invoked and proves its functionality using various figures. You should assure that you proved open figures, for example, the following: 
257
 
254
 
258
 
255
 
259
 ![](images/floodFillTest-small.png)
256
 ![](images/floodFillTest-small.png)
262
 
259
 
263
 ---
260
 ---
264
 
261
 
265
-## Entregas
262
+## Deliverables
266
 
263
 
267
-Utiliza "Entrega" en Moodle para entregar el archivo `tools.cpp` con las funciones que implementaste en esta experiencia de laboratorio. Recuerda utilizar buenas prácticas de programación, incluir el nombre de los programadores y documentar tu programa.
264
+Use "Deliverables" in Moodle to hand in the archive  `tools.cpp` with the functions that you implemented in this laboratory experience. Remember to use good programming techniques, include the names of the programmers involved, and to document your program.
268
 
265
 
269
 ---
266
 ---
270
 
267
 
271
 ---
268
 ---
272
 
269
 
273
-##Referencias
270
+##References
274
 
271
 
275
 [1] Alyce Brady and Pamela Cutter, http://nifty.stanford.edu/2005/GridPlotter/
272
 [1] Alyce Brady and Pamela Cutter, http://nifty.stanford.edu/2005/GridPlotter/
276
 
273