-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot.cpp
More file actions
36 lines (29 loc) · 724 Bytes
/
Copy pathplot.cpp
File metadata and controls
36 lines (29 loc) · 724 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
28
29
30
31
32
33
34
35
36
#include <basicgl/Manager.hpp>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
using namespace BasicGL;
int main(int argc, char *argv[])
{
Manager::Init(argc, argv);
Manager::Create("Plot", MODE_2D);
Manager::SetBackground(13, 40, 53);
PlotPtr plt = Manager::CreatePlot();
SeriePtr sint = plt->createSerie("r");
SeriePtr cost = plt->createSerie("b");
float x, y;
for(int i = 0; i < 360*2; i++)
{
float t = (i / 360.0f) * 2 * M_PI;
x = (t / M_PI);
y = sin(t);
sint->add(x, y);
y = cos(t);
cost->add(x, y);
Manager::Pause();
}
Manager::Show();
Manager::Destroy();
return 0;
}