281
|
|
-1. Study the code in the `main()` function in the file `main.cpp`. The line `XYPlotWindow wCircleR5;` creates a `wCircleR5` object that will be the window where the graph will be drawn, in this case the graph of a circle of radius 5. In a similar way, the objects `wCircle` and `wButterfly` are created. Observe the `for` cycle. In this cycle a series of values for the angle $$t$$ are generated and the function `circle` is called, passing the value for $$t$$ and the references to $$x$$ and $$y$$. The `circle` function does not return a value, but using parameters by reference, it calculates the values for the coordinates $$xCoord$$ and $$yCoord$$ for the circle with center in the origin and radius 5, and allows the `main` function to have these values in the `x` , `y` variables.
|
|
281
|
+1. Study the code in the `main()` function in the file `main.cpp`. The line `XYPlotWindow wCircleR5;` creates a `wCircleR5` object that will be the window where the graph will be drawn, in this case the graph of a circle of radius 5. In a similar way, the objects `wCircle` and `wButterfly` are created. Observe the `for` cycle. In this cycle a series of values for the angle $$t$$ are generated and the function `circle` is called, passing the value for $$t$$ and the references to $$x$$ and $$y$$. The `circle` function does not return a value, but by using parameters by reference, it calculates the values for the coordinates $$xCoord$$ and $$yCoord$$ for the circle with center in the origin and radius 5, and allows the `main` function to have these values in the `x` , `y` variables.
|