KiCad PCB EDA Suite
Loading...
Searching...
No Matches
seg.cpp File Reference
#include <algorithm>
#include <geometry/seg.h>
#include <math/util.h>
#include <math/vector2d.h>
#include <trigo.h>

Go to the source code of this file.

Functions

template<typename T>
int sgn (T aVal)
 
template<typename T>
constexpr T sqrt_helper (T x, T lo, T hi)
 
template<typename T>
constexpr T ct_sqrt (T x)
 
template<typename T>
T isqrt (T x)
 

Variables

template<typename T>
static constexpr T sqrt_max_typed = ct_sqrt( std::numeric_limits<T>::max() )
 

Function Documentation

◆ ct_sqrt()

template<typename T>
T ct_sqrt ( T x)
constexpr

Definition at line 52 of file seg.cpp.

References sqrt_helper(), and T.

◆ isqrt()

template<typename T>
T isqrt ( T x)

Definition at line 61 of file seg.cpp.

References sqrt_max_typed, and T.

Referenced by SEG::Collide(), SEG::Distance(), SEG::Distance(), and SEG::LineDistance().

◆ sgn()

template<typename T>
int sgn ( T aVal)

Definition at line 33 of file seg.cpp.

References T.

Referenced by SEG::LineDistance(), and SEG::mutualDistanceSquared().

◆ sqrt_helper()

template<typename T>
T sqrt_helper ( T x,
T lo,
T hi )
constexpr

Definition at line 39 of file seg.cpp.

References sqrt_helper(), and T.

Referenced by ct_sqrt(), and sqrt_helper().

Variable Documentation

◆ sqrt_max_typed

template<typename T>
T sqrt_max_typed = ct_sqrt( std::numeric_limits<T>::max() )
staticconstexpr

Definition at line 58 of file seg.cpp.

Referenced by isqrt().