Nav apraksta

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* Ive modifico el programa en Junio 3 para anadir ventanas para el circulo, el corazon, y la mariposa */
  2. #include "xyplotwindow.h"
  3. #include <QApplication>
  4. int main(int argc, char *argv[])
  5. {
  6. QApplication a(argc, argv);
  7. XYPlotWindow wLine;
  8. XYPlotWindow wCircle;
  9. XYPlotWindow wHeart;
  10. XYPlotWindow wButterfly;
  11. double y = 0.00;
  12. double x = 0.00;
  13. double increment = 0.01;
  14. // Plot of a segment
  15. for (double t = 0; t < 2*M_PI; t = t + increment) {
  16. x = t;
  17. y = t;
  18. // add x and y as a point in the graph
  19. wLine.AddPointToGraph(x,y);
  20. }
  21. // After all the points have been added, plot and show the graph
  22. wLine.Plot();
  23. wLine.show();
  24. // Plot of a circle
  25. // YOUR CODE FOR THE CIRCLE HERE
  26. // Plot of a heart
  27. // YOUR CODE FOR THE HEART HERE
  28. // Plot of a butterfly
  29. // YOUR CODE FOR THE BUTTERFLY HERE
  30. return a.exec();
  31. }