emlabcpp
modern opinionated embedded C++ library
vec_point_base.h File Reference
+ Include dependency graph for vec_point_base.h:

Go to the source code of this file.

Classes

class  emlabcpp::vec_point_base< Derived, N >
 

Namespaces

 emlabcpp
 MIT License.
 
 emlabcpp::detail
 

Functions

template<typename Derived , std::size_t N>
constexpr bool emlabcpp::detail::vec_point_derived_test (vec_point_base< Derived, N > const &)
 
template<typename Derived , std::size_t N, typename T , typename = typename std::enable_if_t< std::is_arithmetic_v< T > >>
constexpr Derived emlabcpp::operator* (vec_point_base< Derived, N > const &a, T s)
 Multiplies each coordinate of A by item 's' of type T, if T satifies std::is_arithmetic. More...
 
template<typename Derived , std::size_t N, typename T >
constexpr Derived emlabcpp::operator* (T s, vec_point_base< Derived, N > const &a)
 Multiplies each coordinate of A by item 's' of type T, if T satifies std::is_arithmetic. More...
 
template<typename Derived , std::size_t N, typename T , typename = typename std::enable_if_t< std::is_arithmetic_v< T > >>
constexpr Derived emlabcpp::operator/ (vec_point_base< Derived, N > const &a, T s)
 Divides each coordinate of A by item 's' of type T, if T satifies std::is_arithmetic. More...
 
template<typename Derived , std::size_t N>
constexpr float emlabcpp::dot (vec_point_base< Derived, N > const &a, vec_point_base< Derived, N > const &b)
 Calculates the dot product between A and B. More...
 
template<typename Derived , std::size_t N>
constexpr auto emlabcpp::length2_of (vec_point_base< Derived, N > const &a)
 Returns squared distance of A from [0,0,0], this is a squared length of vector represented by A. More...
 
template<typename Derived , std::size_t N>
constexpr float emlabcpp::length_of (vec_point_base< Derived, N > const &a)
 Returns distance of A from [0,0,0], this is a length of vector represented by A. More...
 
template<typename Derived , std::size_t N>
constexpr Derived emlabcpp::normalized (vec_point_base< Derived, N > const &a)
 Calculates normalized version of A, this means that length(A) equals to 1. More...
 
template<typename Derived , std::size_t N>
constexpr Derived emlabcpp::abs (vec_point_base< Derived, N > const &a)
 Creates absolute version of A - removing signs on all dimensions. More...
 
template<typename Derived , std::size_t N>
constexpr Derived emlabcpp::max (vec_point_base< Derived, N > const &a, vec_point_base< Derived, N > const &b)
 
template<typename Derived , std::size_t N>
constexpr Derived const & emlabcpp::min (vec_point_base< Derived, N > const &a, vec_point_base< Derived, N > const &b)
 
template<typename Derived , std::size_t N>
constexpr Derived emlabcpp::dimensional_max (vec_point_base< Derived, N > const &a, vec_point_base< Derived, N > const &b)
 Calculates a C, where C[i] = max(A[i], B[i]) holds for 0 <= i < N. More...
 
template<typename Derived , std::size_t N>
constexpr Derived emlabcpp::dimensional_min (vec_point_base< Derived, N > const &a, vec_point_base< Derived, N > const &b)
 Calculates a C, where C[i] = min(A[i], B[i]) holds for 0 <= i < N. More...
 
template<typename Container , typename UnaryFunction = std::identity, typename Derived = std::decay_t< mapped_t< Container, UnaryFunction > >>
constexpr min_max< Derived > emlabcpp::dimensional_min_max_elem (Container const &cont, UnaryFunction &&f=std::identity{})
 
template<typename Derived , std::size_t N>
constexpr Derived emlabcpp::lin_interp (vec_point_base< Derived, N > const &from, vec_point_base< Derived, N > const &goal, float factor)
 

Variables

template<typename T >
concept emlabcpp::vec_point_derived = requires( T val ) { detail::vec_point_derived_test( val ); }