8#ifndef GALAXY_MATH_GENERIC_HPP_
9#define GALAXY_MATH_GENERIC_HPP_
30 template<meta::is_arithmetic Type>
32 inline float normalize(
const Type val,
const Type max)
noexcept
34 return (
static_cast<float>(val) /
static_cast<float>(max));
47 template<
typename Type>
49 inline bool contains(
const std::vector<Type>& cont,
const Type& val)
noexcept
52 std::for_each(cont.begin(), cont.end(), [&](
const Type& var) {
bool contains(const std::vector< Type > &cont, const Type &val) noexcept
See if a vector contains a value.
float normalize(const Type val, const Type max) noexcept
Calc normalized value from range.