add: Circle

This commit is contained in:
Simon Hardt
2022-03-03 22:24:30 +01:00
parent 8a9d0286ef
commit cd309c04f2
4 changed files with 50 additions and 11 deletions

View File

@@ -1,20 +1,19 @@
#include <cmath>
#include <chrono>
#include <cmath>
#include <iostream>
#include <thread>
#include <vector>
using namespace std::chrono_literals;
#include "display/EPD_7in5_V2.hpp"
#include "render/RenderTarget.hpp"
int main()
{
constexpr double pi = 3.14159;
frame::display::EPD_7in5_V2 display{};
display.Init();
@@ -25,7 +24,6 @@ int main()
frame::Vector const center = (display.getSize() / 2);
target.DrawPixel({10, 10}, frame::BLACK);
target.DrawLine({10, 12}, {100, 12}, frame::BLACK);
@@ -33,7 +31,7 @@ int main()
{
auto end = center;
double const x = std::cos(i * pi / 180.f) * 200.f;
double const x = std::cos(i * pi / 180.f) * 200.f;
double const y = std::sin(i * pi / 180.f) * 200.f;
end.x += (int)x;
@@ -42,6 +40,8 @@ int main()
target.DrawLine(center, end);
}
target.DrawCircle(center, 210);
display.Display(target.getImage());
std::this_thread::sleep_for(10s);