Skip to content

Instantly share code, notes, and snippets.

View gist:a86885e8529b5ba13953c363da23f57d
#include <optional>
#include <iostream>
struct Point {
Point(float x, float y): x{x}, y{y} {
}
float x;
float y;
};
@arnaudbrejeon
arnaudbrejeon / pi.cpp
Created March 6, 2017 00:34
Pi estimator
View pi.cpp
#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;