2023-03-14 23:10:31 +01:00
|
|
|
#ifndef POLYGON_GENERATOR_H_INCLUDED
|
|
|
|
#define POLYGON_GENERATOR_H_INCLUDED
|
|
|
|
|
|
|
|
#include "polygons.h"
|
|
|
|
|
|
|
|
#include <cassert>
|
|
|
|
|
|
|
|
namespace poly_generate {
|
|
|
|
|
2023-05-17 13:19:57 +02:00
|
|
|
polygon rectangle(double width,
|
|
|
|
double height,
|
|
|
|
double mass = 1,
|
|
|
|
std::string label = "rectangle");
|
2023-03-14 23:10:31 +01:00
|
|
|
|
2023-05-17 13:19:57 +02:00
|
|
|
inline polygon square(
|
|
|
|
double width, double mass = 1, std::string label = "square") {
|
2023-03-14 23:10:31 +01:00
|
|
|
assert(width > 0);
|
2023-05-17 13:19:57 +02:00
|
|
|
return rectangle(width, width, mass, label);
|
2023-03-14 23:10:31 +01:00
|
|
|
};
|
|
|
|
|
2023-05-17 13:19:57 +02:00
|
|
|
polygon triangle(double side1,
|
|
|
|
double side2,
|
|
|
|
double angle,
|
|
|
|
double mass = 1,
|
|
|
|
std::string label = "triangle");
|
2023-03-14 23:10:31 +01:00
|
|
|
|
2023-05-17 13:19:57 +02:00
|
|
|
polygon regular(double radius,
|
|
|
|
uint n_sides,
|
|
|
|
double mass = 1,
|
|
|
|
std::string label = "regular");
|
2023-04-25 12:01:51 +02:00
|
|
|
|
2023-05-17 13:19:57 +02:00
|
|
|
polygon general(std::vector<vec2d> points,
|
|
|
|
double mass = 1,
|
|
|
|
std::string label = "general");
|
2023-04-25 12:01:51 +02:00
|
|
|
|
2023-03-14 23:10:31 +01:00
|
|
|
}; // namespace poly_generate
|
|
|
|
#endif
|