Move Vectormath main
C++20 game and graphics mathematics
Loading...
Searching...
No Matches
Vec2.hpp File Reference
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <type_traits>
#include <mv/math/Tolerance.hpp>
#include <mv/math/detail/VectorOps.hpp>

Go to the source code of this file.

Classes

class  mv::math::Vec2< T >
 

Namespaces

namespace  mv
 
namespace  mv::math
 

Typedefs

using mv::math::Vec2f = Vec2< float >
 
using mv::math::Vec2d = Vec2< double >
 
using mv::math::Vec2i8 = Vec2< std::int8_t >
 
using mv::math::Vec2u8 = Vec2< std::uint8_t >
 
using mv::math::Vec2i16 = Vec2< std::int16_t >
 
using mv::math::Vec2u16 = Vec2< std::uint16_t >
 
using mv::math::Vec2i32 = Vec2< std::int32_t >
 
using mv::math::Vec2u32 = Vec2< std::uint32_t >
 
using mv::math::Vec2i64 = Vec2< std::int64_t >
 
using mv::math::Vec2u64 = Vec2< std::uint64_t >
 
using mv::math::Vec2i = Vec2i32
 
using mv::math::Vec2u = Vec2u32
 

Functions

template<typename T >
T mv::math::Dot (const Vec2< T > &left, const Vec2< T > &right) noexcept
 
template<typename T >
T mv::math::LengthSquared (const Vec2< T > &value) noexcept
 
template<typename T >
requires std::is_floating_point_v<T>
bool mv::math::IsNearlyEqual (const Vec2< T > &left, const Vec2< T > &right, Tolerance< T > tolerance=Tolerance< T >::Default()) noexcept
 
template<typename T >
requires std::is_floating_point_v<T>
bool mv::math::IsNearlyZero (const Vec2< T > &value, T absoluteTolerance=Tolerance< T >::Default().Absolute) noexcept
 
template<typename T >
requires std::is_floating_point_v<T>
T mv::math::Length (const Vec2< T > &value) noexcept
 
template<typename T >
T mv::math::DistanceSquared (const Vec2< T > &left, const Vec2< T > &right) noexcept
 
template<typename T >
requires std::is_floating_point_v<T>
T mv::math::Distance (const Vec2< T > &left, const Vec2< T > &right) noexcept
 
template<typename T >
Vec2< T > mv::math::Min (const Vec2< T > &left, const Vec2< T > &right) noexcept
 
template<typename T >
Vec2< T > mv::math::Max (const Vec2< T > &left, const Vec2< T > &right) noexcept
 
template<typename T >
Vec2< T > mv::math::Clamp (const Vec2< T > &value, const Vec2< T > &minimum, const Vec2< T > &maximum) noexcept
 
template<typename T >
Vec2< T > mv::math::Clamp (const Vec2< T > &value, T minimum, T maximum) noexcept
 
template<typename T >
requires (std::is_signed_v<T> || std::is_floating_point_v<T>)
Vec2< T > mv::math::Abs (const Vec2< T > &value) noexcept
 
template<typename T >
requires (std::is_signed_v<T> || std::is_floating_point_v<T>)
Vec2< T > mv::math::Sign (const Vec2< T > &value) noexcept
 
template<typename T >
requires std::is_floating_point_v<T>
Vec2< T > mv::math::LerpUnclamped (const Vec2< T > &from, const Vec2< T > &to, T amount) noexcept
 
template<typename T >
requires std::is_floating_point_v<T>
Vec2< T > mv::math::Lerp (const Vec2< T > &from, const Vec2< T > &to, T amount) noexcept