Euphoria
range.h File Reference
#include <type_traits>
#include "eu/base/angle.h"
#include "eu/assert/assert.h"

Go to the source code of this file.

Classes

struct  eu::R< T >
 A (inclusive) range between two values. More...

Namespaces

namespace  eu

Functions

template<typename T>
R< T > eu::make_range (T min, T max)
 Create a range from min to max (inclusive).
template<typename T>
R< T > eu::make_range (T max)
 Create a range from zero (0) to max (inclusive).
float eu::from_01f (float lower_bound, float upper_bound, float value)
template<typename T>
eu::from_01 (const R< T > &range, float value)
 Converts a value in 0-1 range to a custom range.
template<>
float eu::from_01 (const R< float > &range, float value)
template<typename T>
float eu::to01 (const R< T > &range, T value)
 Converts a value in a range to the 0-1 range.
template<typename T>
eu::get360_angular (const R< T > &range, float value)
template<typename T, typename F>
eu::remap_to (const R< F > &from, const R< T > &to, F value)
 Remaps a value from one range to another.
template<typename T>
bool eu::is_within (const R< T > &range, T value)
 Returns true if a value is withing a range.
template<typename T>
eu::keep_within (const R< T > &range, T value)
 Returns a value that is kept within the range.
template<typename T>
eu::wrap (const R< T > &range, T value)
 Returns a value that wraps around the range.

Variables

constexpr R< float > eu::r01 = { 0.0f, 1.0f}
 A range going from 0 to 1.
constexpr R< float > eu::r11 = { -1.0f, 1.0}