Kwwiker

Untitled

Nov 12th, 2020
122
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void checkSin() {
  2.     cout << "\n\n\n\n\n\n\n\n\n";
  3.     float x;
  4.     HDC hDC = GetDC(GetConsoleWindow());
  5.     HPEN Pen = CreatePen(PS_SOLID, 2, RGB(255, 255, 255));
  6.     SelectObject(hDC, Pen);
  7.     MoveToEx(hDC, 0, 300, NULL);
  8.     LineTo(hDC, 600, 300);
  9.     MoveToEx(hDC, 300, 0, NULL);
  10.     LineTo(hDC, 300, 600);
  11.     #define graphic(x) (sin(x)) //график который будет строится
  12.     //#define graphic(x) ((sqrt(cos(x))*cos(300*x)+sqrt(abs(x))-0.7)*pow((4-x*x),0.01)) //график который будет строится (сердце)
  13.  
  14.     Pen = CreatePen(PS_SOLID, 2, RGB(255, 0, 0));
  15.     SelectObject(hDC, Pen);
  16.     for (x = -15.0f; x <= 15.0f; x += 0.0001f) // O(300,300) - center
  17.     {
  18.         MoveToEx(hDC, 20 * x + 300, -20 * graphic(x) + 300, NULL);//20 - scale
  19.         LineTo(hDC, 20 * x + 300, -20 * graphic(x) + 300);
  20.     }
  21. }
RAW Paste Data