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-04-02 21:53:21 +02:00
|
|
|
polygon rectangle(double width, double height, double mass = 1);
|
2023-03-14 23:10:31 +01:00
|
|
|
|
2023-04-02 21:53:21 +02:00
|
|
|
inline polygon square(double width, double mass = 1) {
|
2023-03-14 23:10:31 +01:00
|
|
|
assert(width > 0);
|
2023-04-02 21:53:21 +02:00
|
|
|
return rectangle(width, width, mass);
|
2023-03-14 23:10:31 +01:00
|
|
|
};
|
|
|
|
|
2023-04-02 21:53:21 +02:00
|
|
|
polygon triangle(double side1, double side2, double angle, double mass = 1);
|
2023-03-14 23:10:31 +01:00
|
|
|
|
2023-04-25 12:01:51 +02:00
|
|
|
polygon regular(double radius, uint n_sides, double mass = 1);
|
|
|
|
|
2023-05-06 14:04:58 +02:00
|
|
|
polygon general(std::vector<vec2d> points, double mass = 1);
|
2023-04-25 12:01:51 +02:00
|
|
|
|
2023-03-14 23:10:31 +01:00
|
|
|
}; // namespace poly_generate
|
|
|
|
#endif
|