Skip to content

Instantly share code, notes, and snippets.

View Przemekkkth's full-sized avatar

Przemek Bądaruk Przemekkkth

View GitHub Profile
@Przemekkkth
Przemekkkth / analog_clock_sfml.cpp
Last active July 15, 2023 17:28
A SFML app which shows an analog clock.
#include <SFML/Graphics.hpp>
#include <algorithm>
#include <cmath>
#include <iostream>
#include <chrono>
#include <ctime>
static float DEG_TO_RAD(float degrees)
{
return degrees * (M_PI / 180);
@Przemekkkth
Przemekkkth / cardioid_sfml.cpp
Created June 29, 2023 17:46
A SFML application that draws a cardioid.
#include <SFML/Graphics.hpp>
#include <algorithm>
#include <cmath>
class Cardioid
{
public:
Cardioid()
: m_radius(400), m_num_lines(150), m_counter(0.0f), m_inc(0.01f), m_translate(sf::Vector2i(1000/2, 600/2)){}
void draw(sf::RenderWindow& w)
@Przemekkkth
Przemekkkth / main.cpp
Last active June 30, 2023 06:57
A Qt/C++ application that draws a cardioid
#include <QApplication>
#include <QWidget>
#include <QTimer>
#include <QElapsedTimer>
#include <QPoint>
#include <QPainter>
#include <QObject>
#include <algorithm>
#include <cmath>