All I want to do is draw a parabola to the console, however I have drawn the x-axis and y-axis. here is the code I am using.
#include<iostream>
using namespace std;
int main()
{
double screen_length = 79;
double screen_height = 24;
double minx = -10;
double maxx = 10;
double miny = -10;
double maxy = 100;
double xx = 20 / static_cast<float>(screen_length);
double yy = static_cast<float>(screen_height) / 110;
double xpoint, ypoint;
for (int i = 1; i <= 24; i++)
{
if (i == 23)
{
for (int k = 1; k <= 80; k++)
cout << "-";
}
xpoint = (i - minx)*xx;
for (int c = 1; c <= 80; c++)
{
if (c == 40)
cout << "|";
else
cout << " ";
ypoint = (c - miny)*yy;
if (ypoint == (xpoint * xpoint))
{
cout << "*";
}
}
cout << endl;
yy += yy;
xx += xx;
}
cout << xx << endl << yy << endl;
cout << xpoint << endl << ypoint << endl;
return 0;
}