RSTools 3.1.0
Versatile C++20 utility library
Loading...
Searching...
No Matches
Vector.hpp File Reference
#include <cassert>
#include <cmath>
#include <cstddef>
#include <limits>
#include <ostream>
#include <type_traits>

Go to the source code of this file.

Classes

struct  RST::Maths::Vector2D< T >
 2D vector; arithmetic operators work component-wise, with a vector or a scalar. More...
 
struct  RST::Maths::Vector3D< T >
 3D vector; arithmetic operators work component-wise, with a vector or a scalar. More...
 

Namespaces

namespace  RST
 Root namespace of RSTools.
 
namespace  RST::Maths
 Math helpers: constants, interpolation, random numbers, 2D and 3D vectors and matrices.
 

Typedefs

using RST::Maths::Vec2f = Vector2D< float >
 
using RST::Maths::Vec2d = Vector2D< double >
 
using RST::Maths::Vec2i = Vector2D< int >
 
using RST::Maths::Vec2u = Vector2D< unsigned int >
 
using RST::Maths::Vec3f = Vector3D< float >
 
using RST::Maths::Vec3d = Vector3D< double >
 
using RST::Maths::Vec3i = Vector3D< int >
 
using RST::Maths::Vec3u = Vector3D< unsigned int >
 

Functions

Vector2D operators
template<typename T >
constexpr Vector2D< T > RST::Maths::operator+ (Vector2D< T > lhs, const Vector2D< T > &rhs) noexcept
 
template<typename T >
constexpr Vector2D< T > RST::Maths::operator- (Vector2D< T > lhs, const Vector2D< T > &rhs) noexcept
 
template<typename T >
constexpr Vector2D< T > RST::Maths::operator* (Vector2D< T > lhs, const Vector2D< T > &rhs) noexcept
 
template<typename T >
constexpr Vector2D< T > RST::Maths::operator/ (Vector2D< T > lhs, const Vector2D< T > &rhs) noexcept
 
template<typename T >
constexpr Vector2D< T > RST::Maths::operator* (Vector2D< T > v, std::type_identity_t< T > s) noexcept
 
template<typename T >
constexpr Vector2D< T > RST::Maths::operator* (std::type_identity_t< T > s, Vector2D< T > v) noexcept
 
template<typename T >
constexpr Vector2D< T > RST::Maths::operator/ (Vector2D< T > v, std::type_identity_t< T > s) noexcept
 
template<typename T >
constexpr Vector2D< T > RST::Maths::operator+ (Vector2D< T > v, std::type_identity_t< T > s) noexcept
 
template<typename T >
constexpr Vector2D< T > RST::Maths::operator- (Vector2D< T > v, std::type_identity_t< T > s) noexcept
 
template<typename T >
std::ostream & RST::Maths::operator<< (std::ostream &os, const Vector2D< T > &vec)
 
Vector3D operators
template<typename T >
constexpr Vector3D< T > RST::Maths::operator+ (Vector3D< T > lhs, const Vector3D< T > &rhs) noexcept
 
template<typename T >
constexpr Vector3D< T > RST::Maths::operator- (Vector3D< T > lhs, const Vector3D< T > &rhs) noexcept
 
template<typename T >
constexpr Vector3D< T > RST::Maths::operator* (Vector3D< T > lhs, const Vector3D< T > &rhs) noexcept
 
template<typename T >
constexpr Vector3D< T > RST::Maths::operator/ (Vector3D< T > lhs, const Vector3D< T > &rhs) noexcept
 
template<typename T >
constexpr Vector3D< T > RST::Maths::operator* (Vector3D< T > v, std::type_identity_t< T > s) noexcept
 
template<typename T >
constexpr Vector3D< T > RST::Maths::operator* (std::type_identity_t< T > s, Vector3D< T > v) noexcept
 
template<typename T >
constexpr Vector3D< T > RST::Maths::operator/ (Vector3D< T > v, std::type_identity_t< T > s) noexcept
 
template<typename T >
constexpr Vector3D< T > RST::Maths::operator+ (Vector3D< T > v, std::type_identity_t< T > s) noexcept
 
template<typename T >
constexpr Vector3D< T > RST::Maths::operator- (Vector3D< T > v, std::type_identity_t< T > s) noexcept
 
template<typename T >
std::ostream & RST::Maths::operator<< (std::ostream &os, const Vector3D< T > &vec)