7#include "geometry_common.h"
16 template <std::ranges::range RANGE,
typename T = std::ranges::range_value_t<RANGE>>
17 constexpr bool are_colinear(RANGE
const& range, T tolerance = precision_limits<T>::point_on_line_max_distance)
19 if (std::ranges::size(range) < 3)
22 auto it = std::ranges::begin(range);
25 const auto end = std::ranges::end(range);
28 if (line.distance(*it++) > tolerance)
35 template <std::
floating_po
int T>
36 using tvec_span = std::span<glm::tvec2<T>>;
38 using vec_span = tvec_span<float>;
basic_line_t< T > line_crossing_points(glm::tvec2< T > const &p1, glm::tvec2< T > const &p2)
TODO: Move these to the body as static methods?
constexpr bool are_colinear(RANGE const &range, T tolerance=precision_limits< T >::point_on_line_max_distance)
Checks if the points in range are colinear.