Add geom::sin_over_x
This commit is contained in:
parent
32529137eb
commit
451b4c1e66
1 changed files with 8 additions and 0 deletions
|
|
@ -49,6 +49,14 @@ namespace psemek::geom
|
|||
return x0 * (T(1) - t) + x1 * t;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T sin_over_x(T const & x)
|
||||
{
|
||||
if (std::abs(x) < std::numeric_limits<T>::epsilon())
|
||||
return T{1};
|
||||
return std::sin(x) / x;
|
||||
}
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue