Advertisement
sad-ronin-v

2 step of RGR ⚛ (diagram)

Nov 16th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.00 KB | None | 0 0
  1. #include <Windows.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4. #include <conio.h>
  5. #include <stdio.h>
  6. void main()
  7. {
  8. double x;
  9. printf(" y\n");
  10. for (int j = 0; j < 5; j++)
  11. {
  12. printf("\n");
  13. }
  14. printf(" x\n");
  15. for (int j = 0; j < 7; j++)
  16. {
  17. printf("\n");
  18. }
  19. HDC hDC = GetDC(GetConsoleWindow());
  20. HPEN Pen = CreatePen(PS_SOLID, 2, RGB(255, 255, 255));
  21. HPEN PenF1 = CreatePen(PS_SOLID, 4, RGB(204, 123, 31));
  22. HPEN PenF2 = CreatePen(PS_SOLID, 4, RGB(150, 29, 138));
  23. SelectObject(hDC, Pen);
  24. MoveToEx(hDC, 0, 85, NULL);
  25. LineTo(hDC, 200, 85);
  26. MoveToEx(hDC, 100, 0, NULL);
  27. LineTo(hDC, 100, 170);
  28. SelectObject(hDC, PenF1);
  29. for (x = -1; x <=3; x += 0.0001)
  30. {
  31. MoveToEx(hDC, 20 * x + 100, -20 * (pow(2.0,-x)/100) + 85, NULL);
  32. LineTo(hDC, 20 * x + 100, -20 * (pow(2.0,-x)/100) + 85);
  33. }
  34. SelectObject(hDC, PenF2);
  35. for (x = -1; x <=3; x += 0.0001)
  36. {
  37. MoveToEx(hDC, 20 * x + 100, -20 * (20/(1+x*x)) + 85, NULL);
  38. LineTo(hDC, 20 * x + 100, -20 * (20/(1+x*x)) + 85);
  39. }
  40. _getch();
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement