View gist:a86885e8529b5ba13953c363da23f57d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <optional> | |
#include <iostream> | |
struct Point { | |
Point(float x, float y): x{x}, y{y} { | |
} | |
float x; | |
float y; | |
}; |
View pi.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <algorithm> | |
#include <cmath> | |
#include <iostream> | |
#include <random> | |
#include <vector> | |
using point_t = std::pair<double, double>; | |
std::vector<point_t> generateRandomPointsInSquare(double length, size_t nbPoints) { | |
std::random_device random_device; |