ToyGine2 26.2.0
Game Engine for retro consoles
Loading...
Searching...
No Matches
utils.hpp File Reference

General math utilities: abs, isEqual, deg2rad, rad2deg. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  toy
 Root namespace containing all engine modules.
namespace  toy::math
 Mathematical types, constants, and utilities: fixed-point, vectors, point.

Functions

template<typename T>
constexpr T toy::math::abs (const T &value) noexcept
 Returns the absolute value of value.
template<typename T>
constexpr bool toy::math::isEqual (const T &a, const T &b, T absEpsilon=8 *numeric_limits< T >::epsilon(), T relEpsilon=64 *numeric_limits< T >::epsilon()) noexcept
 Compares two values for approximate equality.
template<typename T>
constexpr T toy::math::deg2rad (const T &angle) noexcept
 Converts angle from degrees to radians.
template<typename T>
constexpr T toy::math::rad2deg (const T &angle) noexcept
 Converts angle from radians to degrees.

Detailed Description

General math utilities: abs, isEqual, deg2rad, rad2deg.

Declares overloads in namespace toy::math for signed integers, floating-point, and fixed-point types.

Note
Included by math.hpp; do not include this file directly.