[nnm] No Nonsense Math 0.5.0
A No-Nonsense, C++ 17, single-header-only Math library geared towards graphics programming.
Loading...
Searching...
No Matches
nnm.hpp File Reference
#include <cmath>
#include <cstdint>
#include <functional>
#include <optional>

Go to the source code of this file.

Classes

class  nnm::Vector2< Real >
class  nnm::Vector2i< Int >
struct  nnm::Vector2i< Int >::Hash
class  nnm::Vector3< Real >
class  nnm::Vector3i< Int >
struct  nnm::Vector3i< Int >::Hash
class  nnm::Vector4< Real >
class  nnm::Quaternion< Real >
class  nnm::Matrix2< Real >
class  nnm::Basis2< Real >
class  nnm::Matrix3< Real >
class  nnm::Transform2< Real >
class  nnm::Basis3< Real >
class  nnm::Matrix4< Real >
class  nnm::Transform3< Real >

Namespaces

namespace  nnm

Macros

#define NNM_BOUNDS_CHECK_ASSERT(msg, expression)

Typedefs

using nnm::Vector2f = Vector2<float>
using nnm::Vector2d = Vector2<double>
using nnm::Vector2ii = Vector2i<int>
using nnm::Vector2i8 = Vector2i<int8_t>
using nnm::Vector2i16 = Vector2i<int16_t>
using nnm::Vector2i32 = Vector2i<int32_t>
using nnm::Vector2i64 = Vector2i<int64_t>
using nnm::Vector2iu = Vector2i<unsigned int>
using nnm::Vector2u8 = Vector2i<uint8_t>
using nnm::Vector2u16 = Vector2i<uint16_t>
using nnm::Vector2u32 = Vector2i<uint32_t>
using nnm::Vector2u64 = Vector2i<uint64_t>
using nnm::Vector3f = Vector3<float>
using nnm::Vector3d = Vector3<double>
using nnm::Vector3ii = Vector3i<int>
using nnm::Vector3i8 = Vector3i<int8_t>
using nnm::Vector3i16 = Vector3i<int16_t>
using nnm::Vector3i32 = Vector3i<int32_t>
using nnm::Vector3i64 = Vector3i<int64_t>
using nnm::Vector3iu = Vector3i<unsigned int>
using nnm::Vector3u8 = Vector3i<uint8_t>
using nnm::Vector3u16 = Vector3i<uint16_t>
using nnm::Vector3u32 = Vector3i<uint32_t>
using nnm::Vector3u64 = Vector3i<uint64_t>
using nnm::Vector4f = Vector4<float>
using nnm::Vector4d = Vector4<double>
using nnm::QuaternionF = Quaternion<float>
using nnm::QuaternionD = Quaternion<double>
using nnm::Matrix2f = Matrix2<float>
using nnm::Matrix2d = Matrix2<double>
using nnm::Basis2f = Basis2<float>
using nnm::Basis2d = Basis2<double>
using nnm::Matrix3f = Matrix3<float>
using nnm::Matrix3d = Matrix3<double>
using nnm::Transform2f = Transform2<float>
using nnm::Transform2d = Transform2<double>
using nnm::Basis3f = Basis3<float>
using nnm::Basis3d = Basis3<double>
using nnm::Matrix4f = Matrix4<float>
using nnm::Matrix4d = Matrix4<double>
using nnm::Transform3f = Transform3<float>
using nnm::Transform3d = Transform3<double>

Functions

template<typename Real>
constexpr Real nnm::pi ()
template<typename Real>
constexpr Real nnm::epsilon ()
template<typename Num>
constexpr Num nnm::sign (const Num value)
template<typename Num>
constexpr Num nnm::abs (const Num value)
template<typename Num>
constexpr Num nnm::max (const Num a, const Num b)
template<typename Num, typename... Rest>
constexpr Num nnm::max (const Num first, const Rest... rest)
template<typename Real>
constexpr bool nnm::approx_zero (const Real value)
template<typename Real>
constexpr bool nnm::approx_equal (const Real a, const Real b)
template<typename Real>
constexpr bool nnm::approx_less (const Real a, const Real b)
template<typename Real>
constexpr bool nnm::approx_greater (const Real a, const Real b)
template<typename Real>
constexpr bool nnm::approx_less_equal (const Real a, const Real b)
template<typename Real>
constexpr bool nnm::approx_greater_equal (const Real a, const Real b)
template<typename Real>
constexpr bool nnm::approx_less_zero (const Real value)
template<typename Real>
constexpr bool nnm::approx_greater_zero (const Real value)
template<typename Real>
constexpr bool nnm::approx_less_equal_zero (const Real value)
template<typename Real>
constexpr bool nnm::approx_greater_equal_zero (const Real value)
template<typename Real>
Real nnm::ceil (const Real value)
template<typename Num>
constexpr Num nnm::clamp (const Num value, const Num min, const Num max)
template<typename Real>
Real nnm::sqrt (const Real value)
template<typename Real>
Real nnm::pow (const Real base, const Real power)
template<typename Num>
constexpr Num nnm::sqrd (const Num value)
template<typename Real>
Real nnm::modf (const Real dividend, const Real divisor)
template<typename Int>
constexpr Int nnm::mod (const Int dividend, const Int divisor)
template<typename Real>
Real nnm::remf (const Real dividend, const Real divisor)
template<typename Int>
constexpr Int nnm::rem (const Int dividend, const Int divisor)
template<typename Real>
Real nnm::normalize_angle (const Real angle)
template<typename Real>
bool nnm::angle_in_range (const Real angle, const Real from, const Real to)
template<typename Real>
Real nnm::floor (const Real value)
template<typename Real>
constexpr Real nnm::lerp (const Real from, const Real to, const Real weight)
template<typename Real>
constexpr Real nnm::lerp_clamped (const Real from, const Real to, const Real weight)
template<typename Real>
Real nnm::sin (const Real value)
template<typename Real>
Real nnm::cos (const Real value)
template<typename Real>
Real nnm::tan (const Real value)
template<typename Real>
Real nnm::round (const Real value)
template<typename Real>
Real nnm::atan (const Real value)
template<typename Real>
Real nnm::atan2 (const Real y, const Real x)
template<typename Real>
constexpr Real nnm::radians (const Real degrees)
template<typename Real>
constexpr Real nnm::degrees (const Real radians)
template<typename Real>
Real nnm::asin (const Real value)
template<typename Real>
Real nnm::acos (const Real value)
template<typename Num>
constexpr Num nnm::min (const Num a, const Num b)
template<typename Num, typename... Rest>
constexpr Num nnm::min (const Num first, const Rest... rest)
template<typename Real>
Real nnm::log2 (const Real value)
template<typename Real>
Vector2< Real > constexpr nnm::operator* (const Real value, const Vector2< Real > &vector)
template<typename Real>
Vector2< Real > constexpr nnm::operator/ (const Real value, const Vector2< Real > &vector)
template<typename Int>
constexpr Vector2i< Int > nnm::operator* (const Int value, const Vector2i< Int > &vector)
template<typename Int>
constexpr Vector2i< Int > nnm::operator/ (const Int value, const Vector2i< Int > &vector)
template<typename Int>
constexpr Vector2i< Int > nnm::operator% (const Int value, const Vector2i< Int > &vector)
template<typename Real>
constexpr Vector3< Real > nnm::operator* (const Real value, const Vector3< Real > &vector)
template<typename Real>
constexpr Vector3< Real > nnm::operator/ (const Real value, const Vector3< Real > &vector)
template<typename Int>
constexpr Vector3i< Int > nnm::operator* (const Int value, const Vector3i< Int > &vector)
template<typename Int>
constexpr Vector3i< Int > nnm::operator/ (const Int value, const Vector3i< Int > &vector)
template<typename Int>
constexpr Vector3i< Int > nnm::operator% (const Int value, const Vector3i< Int > &vector)
template<typename Real>
constexpr Vector4< Real > nnm::operator* (const Real value, const Vector4< Real > &vector)
template<typename Real>
constexpr Vector4< Real > nnm::operator/ (const Real value, const Vector4< Real > &vector)
template<typename Real>
constexpr Matrix2< Real > nnm::operator* (const Real value, const Matrix2< Real > &matrix)
template<typename Real>
constexpr Matrix2< Real > nnm::operator/ (const Real value, const Matrix2< Real > &matrix)
template<typename Real>
constexpr Matrix3< Real > nnm::operator* (const Real value, const Matrix3< Real > &matrix)
template<typename Real>
constexpr Matrix3< Real > nnm::operator/ (const Real value, const Matrix3< Real > &matrix)
template<typename Real>
constexpr Matrix4< Real > nnm::operator* (const Real value, const Matrix4< Real > &matrix)
template<typename Real>
constexpr Matrix4< Real > nnm::operator/ (const Real value, const Matrix4< Real > &matrix)

Macro Definition Documentation

◆ NNM_BOUNDS_CHECK_ASSERT

#define NNM_BOUNDS_CHECK_ASSERT ( msg,
expression )