11 template <
typename coll_t>
13 const coll_t&
vertices) noexcept(
false) {
15 "Must be collection of Vector2");
18 for (
size_t i = 0;
i <
N;
i++) {
19 size_t j = (
i + 1) % N;
29 for (
size_t k = 0;
k <
N;
k++) {
30 if (
k ==
i ||
k == j) {
35 double dot = normal.dot(c - a);
38 ref = std::signbit(dot);
43 if (std::signbit(dot) != ref) {
44 throw std::logic_error(
45 "ConvexPolygon: Given vertices do not form convex hull");
51 template <
typename coll_t>
58 for (
size_t i = 1;
i < vertices.size();
i++) {
59 vmax = vmax.cwiseMax(vertices[
i]);
60 vmin = vmin.cwiseMin(vertices[i]);
68 const std::vector<Acts::Vector2>&
vertices) noexcept(
false)
69 : m_vertices(), m_boundingBox(makeBoundingBox(
vertices)) {
71 "Size and number of given vertices do not match.");
72 for (
size_t i = 0;
i <
N;
i++) {
88 : m_vertices(), m_boundingBox(0., 0.) {
89 for (
size_t i = 0;
i <
N;
i++) {
92 makeBoundingBox(m_vertices);
104 return bcheck.
isInside(lposition, m_vertices);
109 unsigned int )
const {
110 return {m_vertices.begin(), m_vertices.end()};
115 return m_boundingBox;
120 convex_impl(m_vertices);