|
@@ -117,11 +117,12 @@ To plot a curve that is described by parametric equations, we compute the $$x$$
|
117
|
117
|
|
118
|
118
|
**Instructions**
|
119
|
119
|
|
120
|
|
-1. Download the folder `expressions-prettyplots` from `Bitbucket` usig a terminal, moving to the direcory `Documents/eip`, and writing the command `git clone http://bitbucket.org/eip-uprrp/expressions-prettyplots`.
|
|
120
|
+1. Load the project `prettyPlot` into `QtCreator`. There are two ways to do this:
|
121
|
121
|
|
122
|
|
-2. Load the project `prettyPlot` by doube cliking on the `prettyPlot.pro` file that can be found in the `Documents/eip/expressions-prettyplots` directory on your computer.
|
|
122
|
+ * Using the virtual machine: Double click the file `prettyPlot.pro` located in the folder `/home/eip/labs/expressions-prettyplots` of your virtual machine.
|
|
123
|
+ * Downloading the project’s folder from `Bitbucket`: Use a terminal and write the command `git clone http:/bitbucket.org/eip-uprrp/expressions-prettyplots` to download the folder `expressions-prettyplots` from `Bitbucket`. Double click the file `prettyPlot.pro` located in the folder that you downloaded to your computer.
|
123
|
124
|
|
124
|
|
-3. Configure the project and run the program by clicking the green arrow in the menu on the left side of the Qt Creator window. The program should display a window similar to the one in Figure 3.
|
|
125
|
+2. Configure the project and run the program by clicking the green arrow in the menu on the left side of the Qt Creator window. The program should display a window similar to the one in Figure 3.
|
125
|
126
|
|
126
|
127
|
---
|
127
|
128
|
|
|
@@ -131,7 +132,7 @@ To plot a curve that is described by parametric equations, we compute the $$x$$
|
131
|
132
|
|
132
|
133
|
---
|
133
|
134
|
|
134
|
|
-4. The file `main.cpp` (in Sources) contains the function `main()` where you will be adding code. Open this file and study the code.
|
|
135
|
+3. The file `main.cpp` (in Sources) contains the function `main()` where you will be adding code. Open this file and study the code.
|
135
|
136
|
|
136
|
137
|
QApplication a(argc, argv);
|
137
|
138
|
XYPlotWindow wLine;
|
|
@@ -160,9 +161,9 @@ To plot a curve that is described by parametric equations, we compute the $$x$$
|
160
|
161
|
|
161
|
162
|
The expressions for $$x$$ and $$y$$ are parametric equations for the line that passes through the origin and has the same value for $$x$$ and $$y$$. Explain why this line only goes from 0 to approximately 6.
|
162
|
163
|
|
163
|
|
-5. You will now write the code needed to plot a circle. The line `XYPlotWindow wCircle;` creates the object `wCircle` for the window that will contain the plot of the circle. Using the code that plotted the segment as inspiration, write the necessary code for your program to graph a circle of radius 3 and centered at the origin. Run your program and, if it is necessary, modify the code until you get the right plot. Remember that the circle should be plotted inside the `wCircle` object. Thus, when you invoke the `AddPointToGraph(x,y)`, `Plot` and `show` methods, they should be preceeded by `wCircle`; e.g. `wCircle.show()`.
|
|
164
|
+4. You will now write the code needed to plot a circle. The line `XYPlotWindow wCircle;` creates the object `wCircle` for the window that will contain the plot of the circle. Using the code that plotted the segment as inspiration, write the necessary code for your program to graph a circle of radius 3 and centered at the origin. Run your program and, if it is necessary, modify the code until you get the right plot. Remember that the circle should be plotted inside the `wCircle` object. Thus, when you invoke the `AddPointToGraph(x,y)`, `Plot` and `show` methods, they should be preceeded by `wCircle`; e.g. `wCircle.show()`.
|
164
|
165
|
|
165
|
|
-6. Your next task is to plot a curve with the following parametric equations:
|
|
166
|
+5. Your next task is to plot a curve with the following parametric equations:
|
166
|
167
|
|
167
|
168
|
$$x=16 \sin^3(t)$$
|
168
|
169
|
|
|
@@ -170,7 +171,7 @@ To plot a curve that is described by parametric equations, we compute the $$x$$
|
170
|
171
|
|
171
|
172
|
If you implement the equations correctly, you will see the image of a heart. This plot should be obtained inside an `XYPlotWindow` object called `wHeart`.
|
172
|
173
|
|
173
|
|
-7. You will now plot the curve of the following parametric equations:
|
|
174
|
+6. You will now plot the curve of the following parametric equations:
|
174
|
175
|
|
175
|
176
|
$$x=5\cos(t) \left[ \sin^2(1.2t) + \cos^3(6t) \right]$$
|
176
|
177
|
|