Add geom::half_open_contains
This commit is contained in:
parent
f3d005b4f3
commit
63662124d5
1 changed files with 15 additions and 0 deletions
|
|
@ -24,6 +24,21 @@ namespace psemek::geom
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
bool half_open_contains(interval<T> const & i, T const & x)
|
||||||
|
{
|
||||||
|
return (i.min <= x) && (x < i.max);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T, std::size_t N>
|
||||||
|
bool half_open_contains(box<T, N> const & b, point<T, N> const & p)
|
||||||
|
{
|
||||||
|
for (std::size_t i = 0; i < N; ++i)
|
||||||
|
if (!half_open_contains(b[i], p[i]))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
bool contains(simplex<point<T, 2>, 2> const & t, point<T, 2> const & p)
|
bool contains(simplex<point<T, 2>, 2> const & t, point<T, 2> const & p)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue