Я попытался написать код, чтобы нарисовать треугольник основанием вниз, используя следующую программу:
#include<graphics.h>
#include<conio.h>
using namespace std;
int main()
{
initwindow(400,400,"Triangle");
line(100,100,200,300);
line(200,300,300,100);
line(100,100,300,100);
getch();
return 0;
}
But this gave the wrong output ^^
Whereas when I inverted the coordinates and created a mirror of them, then the triangle was drawn correctly
#include
#include
using namespace std;
int main()
{
initwindow(400,400,"Triangle");
line(100,300,200,100);
line(200,100,300,300);
line(300,300,100,300);
getch();
return 0;
}
введите описание изображения здесь Как исправить эту ошибку?