Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void checkSin() {
- cout << "\n\n\n\n\n\n\n\n\n";
- float x;
- HDC hDC = GetDC(GetConsoleWindow());
- HPEN Pen = CreatePen(PS_SOLID, 2, RGB(255, 255, 255));
- SelectObject(hDC, Pen);
- MoveToEx(hDC, 0, 300, NULL);
- LineTo(hDC, 600, 300);
- MoveToEx(hDC, 300, 0, NULL);
- LineTo(hDC, 300, 600);
- #define graphic(x) (sin(x)) //график который будет строится
- //#define graphic(x) ((sqrt(cos(x))*cos(300*x)+sqrt(abs(x))-0.7)*pow((4-x*x),0.01)) //график который будет строится (сердце)
- Pen = CreatePen(PS_SOLID, 2, RGB(255, 0, 0));
- SelectObject(hDC, Pen);
- for (x = -15.0f; x <= 15.0f; x += 0.0001f) // O(300,300) - center
- {
- MoveToEx(hDC, 20 * x + 300, -20 * graphic(x) + 300, NULL);//20 - scale
- LineTo(hDC, 20 * x + 300, -20 * graphic(x) + 300);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement