7#include "geometry_common.h"
8#include "shape_concepts.h"
12 template <std::
floating_po
int T>
18 static tellipse inside_rect(
trec2<T> const&
rec)
noexcept
20 return {
rec.center(),
rec.half_size() };
23 static tellipse outside_rect(
trec2<T> const&
rec)
noexcept;
28 return (
d.x *
d.x) / (radii.x * radii.x) + (
d.y *
d.y) / (radii.y * radii.y) <= T(1);
35 const auto a = std::max(radii.x, radii.y);
36 const auto b = std::min(radii.x, radii.y);
37 const auto h = ((a - b) * (a - b)) / ((a + b) * (a + b));
38 return glm::pi<T>() * (a + b) * (1 + ((3 *
h) / (10 +
sqrtf(4 - 3 *
h))));
41 glm::tvec2<T> edge_point_alpha(T
t)
const
43 throw "unimplemented";
46 T calculate_area()
const {
return glm::pi<T>() * radii.x * radii.y; }
47 glm::tvec2<T> edge_point(T
t)
const {
return edge_point_alpha(
t / edge_length()); }
50 glm::tvec2<T> projected(glm::tvec2<T>
pt)
const
53 throw "unimplemented";
constexpr auto bit_count
Equal to the number of bits in the type.
constexpr __contains_fn contains
contains(range, el)