Antkeeper  0.0.1
Namespaces | Enumerations | Functions
coordinates.hpp File Reference
#include <engine/geom/primitives/point.hpp>
#include <bit>
#include <cstdint>
#include <cmath>

Go to the source code of this file.

Namespaces

 geom
 Geometric algorithms.
 

Enumerations

enum class  geom::triangle_region : std::uint8_t {
  geom::abc = 0b000 , geom::ab = 0b100 , geom::bc = 0b001 , geom::ca = 0b010 ,
  geom::a = 0b110 , geom::b = 0b101 , geom::c = 0b011
}
 Voronoi regions of a triangle. More...
 

Functions

constexpr bool geom::is_face_region (triangle_region region) noexcept
 Checks whether a triangle voronoi region is a face region. More...
 
constexpr bool geom::is_edge_region (triangle_region region) noexcept
 Checks whether a triangle voronoi region is an edge region. More...
 
constexpr bool geom::is_vertex_region (triangle_region region) noexcept
 Checks whether a triangle voronoi region is a vertex region. More...
 
constexpr std::uint8_t geom::edge_index (triangle_region region) noexcept
 Returns the edge index of an edge region. More...
 
constexpr std::uint8_t geom::vertex_index (triangle_region region) noexcept
 Returns the vertex index of a vertex region. More...
 
template<class T >
constexpr triangle_region geom::barycentric_to_region (const point< T, 3 > &p) noexcept
 Classifies barycentric coordinates according to their Voronoi region. More...
 
template<class T >
constexpr point< T, 3 > geom::barycentric_to_cartesian (const point< T, 3 > &p, const point< T, 3 > &a, const point< T, 3 > &b, const point< T, 3 > &c) noexcept
 Converts Cartesian coordinates to barycentric coordinates. More...
 
template<class T >
constexpr point< T, 3 > geom::cartesian_to_barycentric (const point< T, 3 > &p, const point< T, 3 > &a, const point< T, 3 > &b, const point< T, 3 > &c) noexcept
 Converts Cartesian coordinates to barycentric coordinates. More...
 
template<class T >
point< T, 3 > geom::cartesian_to_spherical (const point< T, 3 > &p)
 Converts Cartesian (rectangular) coordinates to spherical coordinates. More...
 
template<class T >
point< T, 3 > geom::spherical_to_cartesian (const point< T, 3 > &p)
 Converts spherical coordinates to Cartesian (rectangular) coordinates. More...