Skip to content

Instantly share code, notes, and snippets.

#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
#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;