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