-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
27 lines (26 loc) · 853 Bytes
/
test.cpp
File metadata and controls
27 lines (26 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <Windows.h>
//#include <stdlib.h>
#include <math.h>
#include <iostream>
int main(void)
{
HWND hWnd = GetConsoleWindow();
HDC hDC = GetDC(hWnd);
HPEN Pen = CreatePen(PS_SOLID, 2, RGB(255, 255, 255));//цвет осей
SelectObject(hDC, Pen);
MoveToEx(hDC, 0, 200, NULL);
LineTo(hDC, 1000, 200);
MoveToEx(hDC, 500, 0, NULL);
LineTo(hDC, 500, 400);
Pen = CreatePen(PS_SOLID, 2, RGB(255, 255, 255));//цвет графика
SelectObject(hDC, Pen);
for (float x = -74.0f; x <= 75.0f; x += 0.01f) //начало и конец графика
{
MoveToEx(hDC, 10 * x + 250, -10 * sin(x) + 200, NULL); //период/амплитуда/координата по y
LineTo(hDC, 10 * x + 250, -10 * sin(x) + 200);
}
ReleaseDC(hWnd, hDC);
while (true) {
Sleep(0);
}
}