Advertisement
Guest User

Untitled

a guest
Dec 16th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <cmath>
  4. #include <fstream>
  5. #include <sstream>
  6. #include <algorithm>
  7. #include <Windows.h>
  8. #include <stdlib.h>
  9. #include <stdio.h>
  10. #include <conio.h>
  11. #include <iomanip>
  12.  
  13. using namespace std;
  14. void sin_func()//5
  15. {
  16. system("cls");
  17. cout << endl << endl << endl << endl << endl << endl << endl << endl << endl << endl << endl << endl << endl << endl;
  18.  
  19. float x;
  20. HDC hDC = GetDC(GetConsoleWindow());
  21. HPEN Pen = CreatePen(PS_SOLID, 3, RGB(255, 255, 255));
  22. SelectObject(hDC, Pen);
  23. //OX
  24. MoveToEx(hDC, 0, 100, NULL);
  25. LineTo(hDC, 200, 100);
  26. //OY
  27. MoveToEx(hDC, 100, 0, NULL);
  28. LineTo(hDC, 100, 200);
  29. Pen = CreatePen(PS_SOLID, 2, RGB(255, 0, 0));
  30. SelectObject(hDC, Pen);
  31. for (x = -10.0; x <= 10.0; x += 0.01)
  32. {
  33. MoveToEx(hDC, 10 * x + 100, -10 * sin(x) + 100, NULL);
  34. LineTo(hDC, 10 * x + 100, -10 * sin(x) + 100);
  35. }
  36. _getch();
  37.  
  38. }
  39.  
  40. int main() {
  41.  
  42. sin_func();
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement