header_utils
|
Angles. More...
Namespaces | |
namespace | squares |
Classes | |
struct | basic_line_t |
TODO: This all needs to be tested. More... | |
struct | tpolyline |
Polyline. More... | |
Concepts | |
concept | shape |
Shape Concept. | |
concept | area_shape |
Area Shape Concept. | |
Typedefs | |
using | direction_set = enum_flags< direction, uint8_t > |
TODO: names, compass name. | |
using | ellipse = tellipse< float > |
using | rec2 = trec2< float > |
using | irec2 = trec2< int > |
template<std::floating_point T> | |
using | basic_radians_t = named< T, "radians", traits::displacement > |
template<std::floating_point T> | |
using | basic_degrees_t = named< T, "degrees", traits::displacement > |
template<std::floating_point T> | |
using | basic_heading_t = named< T, "heading", traits::location, traits::is_location_of< basic_degrees_t< T > > > |
using | degrees = basic_degrees_t< float > |
using | radians = basic_radians_t< float > |
using | heading = basic_heading_t< float > |
template<typename T > | |
using | basic_polar2d_t = named< glm::tvec2< T >, "polar", traits::location > |
using | polar2d = basic_polar2d_t< float > |
using | polygon = tpolygon< float > |
using | ray = tray< float > |
using | segment = tsegment< float > |
using | triangle = ttriangle< float > |
using | indexed_triangle = tindexed_triangle< size_t > |
Functions | |
constexpr direction | operator+ (direction dir, int d) |
constexpr direction | operator- (direction dir, int d) |
constexpr direction & | operator++ (direction &dir) |
constexpr direction & | operator-- (direction &dir) |
constexpr direction | operator++ (direction &dir, int) |
constexpr direction | operator-- (direction &dir, int) |
constexpr direction | opposite (direction dir) |
constexpr direction | next_cardinal (direction dir) |
constexpr direction | prev_cardinal (direction dir) |
constexpr bool | is_valid (direction dir) |
constexpr bool | is_cardinal (direction dir) |
constexpr bool | is_diagonal (direction dir) |
constexpr int | horizontal (direction dir) |
constexpr int | vertical (direction dir) |
constexpr degrees | to_angle (direction val) |
constexpr glm::ivec2 | to_ivec (direction val) |
constexpr glm::vec2 | to_vec (direction val) |
constexpr ghassanpl::align | to_alignment (direction val) |
direction | to_direction (degrees angle) |
direction | to_direction (glm::vec2 val) |
direction | to_direction (glm::ivec2 vec) |
template<typename T > | |
constexpr T | dot (glm::tvec2< T > const &a, glm::tvec2< T > const &b) noexcept |
template<typename T > | |
constexpr glm::tvec2< T > | length (glm::tvec2< T > const &a) noexcept |
template<typename T > | |
constexpr std::pair< glm::tvec2< T >, T > | dir_and_length (glm::tvec2< T > const &a) noexcept |
template<typename T > | |
constexpr glm::tvec2< T > | with_length (glm::tvec2< T > const &a, T length) noexcept |
template<typename T > | |
constexpr glm::tvec2< T > | clamp_length (glm::tvec2< T > const &a, T min, T max) noexcept |
template<typename T > | |
constexpr glm::tvec2< T > | max_length (glm::tvec2< T > const &a, T max) noexcept |
template<typename TARGET , std::floating_point T> requires std::same_as<TARGET, basic_degrees_t<T>> | |
constexpr TARGET | named_cast (basic_radians_t< T > const &radians) |
template<typename TARGET , std::floating_point T> requires std::same_as<TARGET, basic_radians_t<T>> | |
constexpr TARGET | named_cast (basic_degrees_t< T > const °rees) |
template<typename T > | |
auto | rho (basic_polar2d_t< T > const &polar) |
template<typename T > | |
auto | phi (basic_polar2d_t< T > const &polar) |
template<typename T > | |
auto | theta (basic_polar2d_t< T > const &polar) |
template<typename T > | |
basic_polar2d_t< T > | polar (glm::tvec2< T > const &euclidean) |
template<typename T > | |
glm::tvec2< T > | euclidean (basic_polar2d_t< T > const &polar) |
template<typename T > | |
basic_line_t< T > | line_crossing_points (glm::tvec2< T > const &p1, glm::tvec2< T > const &p2) |
template<typename T > | |
basic_line_t< T > | line_from_dir (glm::tvec2< T > const &dir) |
template<std::ranges::range RANGE, typename T = std::ranges::range_value_t<RANGE>> | |
constexpr bool | are_colinear (RANGE const &range, T tolerance=precision_limits< T >::point_on_line_max_distance) |
template<typename POLY > | |
auto | calculate_indexed_triangle_area (POLY const &poly, indexed_triangle const &triangle) |
template<typename TR > | |
auto | calculate_total_area (TR const &trpoly) |
template<typename T > | |
polygon_triangulation< T > | triangulate (tpolygon< T > const &poly) |
template<typename T > | |
tpolygon< T > | polygon_from (const trec2< T > &r) |
template<typename T > | |
std::array< tsegment< T >, 4 > | edges_of (const trec2< T > &r) |
template<typename T , shape< T > S> | |
auto | distance (S const &sh, glm::tvec2< T > pt) |
template<typename T , shape< T > S> | |
auto | distance (glm::tvec2< T > pt, S const &sh) |
template<typename T , shape< T > S> | |
auto | distance_squared (S const &sh, glm::tvec2< T > pt) |
template<typename T , shape< T > S> | |
auto | distance_squared (glm::tvec2< T > pt, S const &sh) |
Angles.
Lines.
struct ghassanpl::geometry::tpolyline |
using ghassanpl::geometry::basic_degrees_t = typedef named<T, "degrees", traits::displacement> |
Definition at line 149 of file geometry_common.h.
using ghassanpl::geometry::basic_heading_t = typedef named<T, "heading", traits::location, traits::is_location_of<basic_degrees_t<T> >> |
Definition at line 151 of file geometry_common.h.
using ghassanpl::geometry::basic_polar2d_t = typedef named<glm::tvec2<T>, "polar", traits::location> |
Definition at line 203 of file geometry_common.h.
using ghassanpl::geometry::basic_radians_t = typedef named<T, "radians", traits::displacement> |
Definition at line 148 of file geometry_common.h.
Definition at line 153 of file geometry_common.h.
using ghassanpl::geometry::direction_set = typedef enum_flags<direction, uint8_t> |
TODO: names, compass name.
Definition at line 40 of file direction.h.
Definition at line 155 of file geometry_common.h.
Definition at line 106 of file triangles.h.
Definition at line 56 of file geometry_common.h.
Definition at line 205 of file geometry_common.h.
Definition at line 154 of file geometry_common.h.
Definition at line 55 of file geometry_common.h.
Definition at line 78 of file triangles.h.
Definition at line 13 of file direction.h.
Definition at line 58 of file geometry_common.h.
|
constexprnoexcept |
Definition at line 96 of file geometry_common.h.
|
constexprnoexcept |
Definition at line 80 of file geometry_common.h.
auto ghassanpl::geometry::distance | ( | glm::tvec2< T > | pt, |
S const & | sh | ||
) |
Definition at line 38 of file shape_concepts.h.
auto ghassanpl::geometry::distance | ( | S const & | sh, |
glm::tvec2< T > | pt | ||
) |
Definition at line 37 of file shape_concepts.h.
auto ghassanpl::geometry::distance_squared | ( | glm::tvec2< T > | pt, |
S const & | sh | ||
) |
Definition at line 41 of file shape_concepts.h.
auto ghassanpl::geometry::distance_squared | ( | S const & | sh, |
glm::tvec2< T > | pt | ||
) |
Definition at line 40 of file shape_concepts.h.
|
constexprnoexcept |
Definition at line 65 of file geometry_common.h.
std::array< tsegment< T >, 4 > ghassanpl::geometry::edges_of | ( | const trec2< T > & | r | ) |
Definition at line 26 of file rectangles.h.
glm::tvec2< T > ghassanpl::geometry::euclidean | ( | basic_polar2d_t< T > const & | polar | ) |
Definition at line 220 of file geometry_common.h.
Definition at line 68 of file direction.h.
Definition at line 65 of file direction.h.
Definition at line 66 of file direction.h.
Definition at line 64 of file direction.h.
|
constexprnoexcept |
Definition at line 74 of file geometry_common.h.
basic_line_t< T > ghassanpl::geometry::line_crossing_points | ( | glm::tvec2< T > const & | p1, |
glm::tvec2< T > const & | p2 | ||
) |
Definition at line 255 of file geometry_common.h.
basic_line_t< T > ghassanpl::geometry::line_from_dir | ( | glm::tvec2< T > const & | dir | ) |
Definition at line 261 of file geometry_common.h.
|
constexprnoexcept |
Definition at line 110 of file geometry_common.h.
Definition at line 166 of file geometry_common.h.
Definition at line 159 of file geometry_common.h.
|
constexpr |
Definition at line 57 of file direction.h.
Definition at line 47 of file direction.h.
|
constexpr |
Definition at line 50 of file direction.h.
Definition at line 53 of file direction.h.
Definition at line 48 of file direction.h.
|
constexpr |
Definition at line 51 of file direction.h.
Definition at line 54 of file direction.h.
|
constexpr |
Definition at line 56 of file direction.h.
Definition at line 208 of file geometry_common.h.
basic_polar2d_t< T > ghassanpl::geometry::polar | ( | glm::tvec2< T > const & | euclidean | ) |
Definition at line 212 of file geometry_common.h.
Definition at line 15 of file rectangles.h.
|
constexpr |
Definition at line 58 of file direction.h.
Definition at line 207 of file geometry_common.h.
Definition at line 209 of file geometry_common.h.
|
constexpr |
Definition at line 71 of file direction.h.
|
inline |
Definition at line 89 of file direction.h.
|
inline |
Definition at line 95 of file direction.h.
|
constexpr |
Definition at line 80 of file direction.h.
|
constexpr |
Definition at line 81 of file direction.h.
Definition at line 69 of file direction.h.
|
constexprnoexcept |
Definition at line 89 of file geometry_common.h.
|
inlinestaticconstexpr |
Definition at line 60 of file direction.h.
|
inlinestaticconstexpr |
Definition at line 61 of file direction.h.
|
inlinestaticconstexpr |
Definition at line 62 of file direction.h.
Definition at line 36 of file direction.h.