#include "library.h" const int minx = 0, maxx = 800, sizey = 500; double f(double x) { return 150 + 300*pow(sin(x/48), 2) + 25*cos(x/4); } void plot(double x1, double x2) { if (x2-x1 < 0.5) { const double y1 = f(x1); const double y2 = f(x2); move_to(x1, y1); draw_to(x2, y2); } else { const double xm = (x1 + x2) / 2; plot(x1, xm); plot(xm, x2); } } void main() { make_window(maxx, sizey); move_to(maxx/2, 0); draw_to(maxx/2, sizey); move_to(0, sizey/2); draw_to(maxx, sizey/2); move_to(maxx/2, sizey/2); write_string("0", direction::center); set_pen_width(3); plot(minx, maxx); }