NRE_Vector2D.hpp File Reference

Declaration of Math's API's Object : Vector2D. More...

#include <Utility/String/NRE_String.hpp>
#include <Utility/Interfaces/Stringable/NRE_Stringable.hpp>
#include "../../NRE_Math.hpp"
#include <cassert>
#include "NRE_Vector2D.tpp"

Go to the source code of this file.

Classes

class  NRE::Math::Vector3D< T >
 A cartesian 3D vector, 2D homogeneous. More...
 
class  NRE::Math::Vector4D< T >
 A cartesian 4D vector, 3D homogeneous. More...
 
class  NRE::Math::Vector2D< T >
 A cartesian 2D vector. More...
 
struct  std::common_type< NRE::Math::Vector2D< T >, NRE::Math::Vector2D< K > >
 

Namespaces

 NRE
 The NearlyRealEngine's global namespace.
 
 Math
 Math's API.
 
 std
 The stl standard namespace.
 

Typedefs

template<class T >
using NRE::Math::Point2D = Vector2D< T >
 

Functions

template<class T , class K , typename = UseIfArithmetic<K>>
constexpr Vector2D< std::common_type_t< T, K > > NRE::Math::operator* (K k, Vector2D< T > const &u)
 
template<class T >
Vector2D< T > NRE::Math::normalize (Vector2D< T > const &u)
 
template<class T , class K , typename = UseIfArithmetic<K>>
Vector2D< std::common_type_t< T, K > > NRE::Math::pow (Vector2D< T > const &u, K k)
 
template<class T , class K >
Vector2D< std::common_type_t< T, K > > NRE::Math::pow (Vector2D< T > const &u, Vector2D< K > const &p)
 
template<class T , class K >
constexpr Vector2D< std::common_type_t< T, K > > NRE::Math::reflect (Vector2D< T > const &u, Vector2D< K > const &n)
 

Detailed Description

Declaration of Math's API's Object : Vector2D.

Author
Louis ABEL
Date
27/03/2019

Function Documentation

template<class T >
Vector2D<T> NRE::Math::normalize ( Vector2D< T > const &  u)

Return a normalized version of the given vector

Parameters
uthe vector to normalize
Returns
the normalized vector
template<class T , class K , typename = UseIfArithmetic<K>>
constexpr Vector2D<std::common_type_t<T, K> > NRE::Math::operator* ( k,
Vector2D< T > const &  u 
)

Compute the vector resulting in the multiplication of u by k

Parameters
uthe vector
kthe multiplication factor
Returns
the computed vector
template<class T , class K , typename = UseIfArithmetic<K>>
Vector2D<std::common_type_t<T, K> > NRE::Math::pow ( Vector2D< T > const &  u,
k 
)

Return a vector with components raised to the given power

Parameters
uthe vector to raise
kthe power to which to raise the vector
Returns
the raised vector
template<class T , class K >
Vector2D<std::common_type_t<T, K> > NRE::Math::pow ( Vector2D< T > const &  u,
Vector2D< K > const &  p 
)

Return a vector with components raised to the given power

Parameters
uthe vector to raise
pthe power to which to raise the vector
Returns
the raised vector
template<class T , class K >
constexpr Vector2D<std::common_type_t<T, K> > NRE::Math::reflect ( Vector2D< T > const &  u,
Vector2D< K > const &  n 
)

Reflect the given incidence vector with the given normal

Parameters
uthe vector to reflect
nthe normal
Returns
the reflected vector