MathLib
Loading...
Searching...
No Matches
Modules | Classes | Typedefs | Functions | Variables | Friends
Collaboration diagram for Vector2D Types:

Modules

 2D Vector Algebra
 
 Checks
 
 Assertions
 

Classes

struct  BasicVector2D< Type >::BasicRef< RType >
 

Typedefs

using value_type = RType
 The underlying implementation type.
 
using Ref = BasicRef< Type >
 
using ConstRef = BasicRef< const Type >
 

Functions

constexpr BasicRef (RType &x_in, RType &y_in)
 
constexpr BasicRef (const BasicRef &)=default
 
constexpr BasicRef (const BasicVector2D< RType > &other)
 
constexpr BasicRef & operator= (BasicRef input)
 
constexpr BasicRef & operator= (const BasicVector2D< RType > &input)
 
constexpr operator BasicVector2D< RType > () const
 
constexpr operator std::tuple< RType, RType > () const
 
constexpr value_type normSquared () const
 
constexpr value_type norm () const
 
constexpr value_type magnitudeSquared () const
 
constexpr value_type magnitude () const
 
constexpr BasicVector2D< Type > normalized () const
 

Variables

RType & x
 
RType & y
 

Friends

constexpr bool operator== (BasicRef left, BasicRef< U > right)
 
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr bool operator== (BasicRef left, const BasicVector2D< U > &right)
 
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > operator+ (BasicRef left, BasicRef< U > right)
 
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > operator+ (BasicRef left, const BasicVector2D< U > &right)
 
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > operator- (BasicRef left, BasicRef< U > right)
 
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > operator- (BasicRef left, const BasicVector2D< U > &right)
 
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > operator* (BasicRef left, BasicRef< U > right)
 
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > operator* (BasicRef left, const BasicVector2D< U > &right)
 
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > operator* (BasicRef left, const U &scalar)
 
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > operator* (const U &scalar, BasicRef right)
 
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > operator/ (BasicRef left, BasicRef< U > right)
 
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > operator/ (BasicRef left, const BasicVector2D< U > &right)
 
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > operator/ (BasicRef left, U scalar)
 
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<RType, U>
constexpr bool approximately_equal_to (BasicRef value_to_test, BasicRef< U > value_it_should_be, OT tolerance=OT{0.0002})
 
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<RType, U>
constexpr bool approximately_equal_to (BasicRef value_to_test, const BasicVector2D< U > &value_it_should_be, OT tolerance=OT{0.0002})
 
constexpr RType accumulate (BasicRef input)
 
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr RType dot (BasicRef left, BasicRef< U > right)
 
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr RType dot (BasicRef left, const BasicVector2D< U > &right)
 
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr RType dot_normalized (BasicRef left, BasicRef< U > right)
 
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr RType dot_normalized (BasicRef left, const BasicVector2D< U > &right)
 
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr RType cross (BasicRef left, BasicRef< U > right)
 
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr RType cross (BasicRef left, const BasicVector2D< U > &right)
 
constexpr BasicVector2D< RType > normalized (BasicRef input)
 
constexpr BasicVector2D< RType > abs (BasicRef input)
 
constexpr BasicVector2D< RType > fract (BasicRef input)
 
constexpr BasicVector2D< RType > saturate (BasicRef input, RType lower_bound, RType upper_bound)
 
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > lerp (BasicRef input_lower_bound, BasicRef< U > input_upper_bound, float percentage_zero_to_one)
 
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > lerp (BasicRef input_lower_bound, const BasicVector2D< U > &input_upper_bound, float percentage_zero_to_one)
 
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > mix (BasicRef input_lower_bound, BasicRef< U > input_upper_bound, float percentage_zero_to_one)
 
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > mix (BasicRef input_lower_bound, const BasicVector2D< U > &input_upper_bound, float percentage_zero_to_one)
 
std::string format (BasicRef input)
 
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<RType, U>
bool check_if_equal (BasicRef input, BasicRef< U > near_to, OT tolerance=OT{0.0002})
 
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<RType, U>
bool check_if_equal (BasicRef input, const BasicVector2D< U > &near_to, OT tolerance=OT{0.0002})
 
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<RType, U>
bool check_if_not_equal (BasicRef input, BasicRef near_to, OT tolerance=OT{0.0002})
 
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<RType, U>
bool check_if_not_equal (BasicRef input, const BasicVector2D< U > &near_to, OT tolerance=OT{0.0002})
 
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<RType, U>
void CHECK_IF_EQUAL (BasicRef input, BasicRef< U > near_to, OT tolerance=OT{0.0002})
 
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<RType, U>
void CHECK_IF_EQUAL (BasicRef input, const BasicVector2D< U > &near_to, OT tolerance=OT{0.0002})
 
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<RType, U>
void CHECK_IF_NOT_EQUAL (BasicRef input, BasicRef< U > near_to, OT tolerance=OT{0.0002})
 
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<RType, U>
void CHECK_IF_NOT_EQUAL (BasicRef input, const BasicVector2D< U > &near_to, OT tolerance=OT{0.0002})
 
template<std::floating_point OT = float>
void CHECK_IF_ZERO (BasicRef input, OT tolerance=OT{0.0002})
 

Types

using value_type = Type
 The underlying implementation type.
 

Type Aliases

using Vector2Df = BasicVector2D< float >
 
using Vector2Dd = BasicVector2D< double >
 
using Vector2D = BasicVector2D< double >
 
using Vector2Dl = BasicVector2D< long double >
 

Element Access

Type x {}
 
Type y {}
 

Constructors

constexpr BasicVector2D ()=default
 
constexpr BasicVector2D (const Type &x_in, const Type &y_in=0)
 
constexpr BasicVector2D (const std::tuple< Type, Type > &t)
 

Assignment

constexpr BasicVector2D< Type > & operator= (const BasicVector2D &other)=default
 
constexpr BasicVector2D< Type > & operator= (Ref other)
 

Conversion Operators

constexpr operator std::tuple< Type, Type > () const
 

Constants

static constexpr BasicVector2D< Type > unit_x ()
 
static constexpr BasicVector2D< Type > unit_y ()
 
static constexpr BasicVector2D< Type > zero ()
 

Invalid Value Check

bool isNaN () const
 
bool isInf () const
 

Swizzle operations

constexpr BasicVector2D xx () const
 
constexpr BasicVector2D xx ()
 
constexpr BasicVector2D yy () const
 
constexpr BasicVector2D yy ()
 
constexpr ConstRef xy () const &
 
constexpr Ref xy () &
 
constexpr BasicVector2D xy () &&
 
constexpr ConstRef yx () const &
 
constexpr Ref yx () &
 
constexpr BasicVector2D yx () &&
 

Equality

template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr bool operator== (const BasicVector2D &left, const BasicVector2D< U > &right)
 
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<Type, U>
constexpr bool approximately_equal_to (const BasicVector2D &value_to_test, const BasicVector2D< U > &value_it_should_be, OT tolerance=OT{0.0002})
 
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<Type, U>
constexpr bool approximately_equal_to (const BasicVector2D &value_to_test, BasicRef< U > value_it_should_be, OT tolerance=OT{0.0002})
 

Global Functions

constexpr Type accumulate (const BasicVector2D< Type > &input)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr Type dot (const BasicVector2D &left, const BasicVector2D< U > &right)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr Type dot (const BasicVector2D &left, BasicRef< U > right)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr Type dot_normalized (const BasicVector2D &left, const BasicVector2D< U > &right)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr Type dot_normalized (const BasicVector2D &left, BasicRef< U > right)
 
constexpr BasicVector2D< Type > normalized (const BasicVector2D &input)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr Type cross (const BasicVector2D &left, const BasicVector2D< U > &right)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr Type cross (const BasicVector2D< Type > &left, BasicRef< U > right)
 
constexpr BasicVector2D< Type > abs (const BasicVector2D &input)
 
constexpr BasicVector2D< Type > fract (const BasicVector2D &input)
 
constexpr BasicVector2D< Type > saturate (const BasicVector2D &input, const Type lower_bound, Type upper_bound)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr BasicVector2D< Type > lerp (const BasicVector2D &input_lower_bound, const BasicVector2D< U > &input_upper_bound, float percentage_zero_to_one)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr BasicVector2D< Type > lerp (const BasicVector2D &input_lower_bound, BasicRef< U > input_upper_bound, float percentage_zero_to_one)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr BasicVector2D< Type > mix (const BasicVector2D &input_lower_bound, const BasicVector2D< U > &input_upper_bound, float percentage_zero_to_one)
 
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr BasicVector2D< Type > mix (const BasicVector2D &input_lower_bound, BasicRef< U > input_upper_bound, float percentage_zero_to_one)
 
std::string format (const BasicVector2D &input)
 

Detailed Description

Here are the type aliases for BasicVector2D

Typedef Documentation

◆ ConstRef

template<class Type >
using ConstRef = BasicRef<const Type>

Definition at line 413 of file Vector2D.hpp.

◆ Ref

template<class Type >
using Ref = BasicRef<Type>

Definition at line 412 of file Vector2D.hpp.

◆ value_type [1/2]

template<class Type >
using value_type = Type

The underlying implementation type.

Definition at line 26 of file Vector2D.hpp.

◆ value_type [2/2]

template<class Type >
template<class RType >
using value_type = RType

The underlying implementation type.

Definition at line 38 of file Vector2D.hpp.

◆ Vector2D

template<class Type >
using Vector2D = BasicVector2D<double>
related

Definition at line 1125 of file Vector2D.hpp.

◆ Vector2Dd

template<class Type >
using Vector2Dd = BasicVector2D<double>
related

Definition at line 1124 of file Vector2D.hpp.

◆ Vector2Df

template<class Type >
using Vector2Df = BasicVector2D<float>
related

Definition at line 1123 of file Vector2D.hpp.

◆ Vector2Dl

template<class Type >
using Vector2Dl = BasicVector2D<long double>
related

Definition at line 1126 of file Vector2D.hpp.

Function Documentation

◆ BasicRef() [1/3]

template<class Type >
template<class RType >
constexpr BasicRef ( const BasicRef< RType > &  )
constexprdefault

◆ BasicRef() [2/3]

template<class Type >
template<class RType >
constexpr BasicRef ( const BasicVector2D< RType > &  other)
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 42 of file Vector2D.hpp.

◆ BasicRef() [3/3]

template<class Type >
template<class RType >
constexpr BasicRef ( RType &  x_in,
RType &  y_in 
)
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 40 of file Vector2D.hpp.

◆ BasicVector2D() [1/3]

template<class Type >
constexpr BasicVector2D ( )
constexprdefault

◆ BasicVector2D() [2/3]

template<class Type >
constexpr BasicVector2D ( const std::tuple< Type, Type > &  t)
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 426 of file Vector2D.hpp.

◆ BasicVector2D() [3/3]

template<class Type >
constexpr BasicVector2D ( const Type &  x_in,
const Type &  y_in = 0 
)
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 420 of file Vector2D.hpp.

◆ isInf()

template<class Type >
bool isInf ( ) const
inline

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 478 of file Vector2D.hpp.

◆ isNaN()

template<class Type >
bool isNaN ( ) const
inline

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 477 of file Vector2D.hpp.

◆ magnitude()

template<class Type >
constexpr value_type magnitude ( ) const
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 465 of file Vector2D.hpp.

◆ magnitudeSquared()

template<class Type >
constexpr value_type magnitudeSquared ( ) const
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 464 of file Vector2D.hpp.

◆ norm()

template<class Type >
constexpr value_type norm ( ) const
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Todo:
See if we need to use std::hypot()

Definition at line 462 of file Vector2D.hpp.

◆ normalized()

template<class Type >
constexpr BasicVector2D< Type > normalized ( ) const
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 467 of file Vector2D.hpp.

◆ normSquared()

template<class Type >
constexpr value_type normSquared ( ) const
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 461 of file Vector2D.hpp.

◆ operator BasicVector2D< RType >()

template<class Type >
template<class RType >
constexpr operator BasicVector2D< RType > ( ) const
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 146 of file Vector2D.hpp.

◆ operator std::tuple< RType, RType >()

template<class Type >
template<class RType >
constexpr operator std::tuple< RType, RType > ( ) const
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 148 of file Vector2D.hpp.

◆ operator std::tuple< Type, Type >()

template<class Type >
constexpr operator std::tuple< Type, Type > ( ) const
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 449 of file Vector2D.hpp.

◆ operator=() [1/4]

template<class Type >
template<class RType >
constexpr BasicRef & operator= ( BasicRef< RType >  input)
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 44 of file Vector2D.hpp.

◆ operator=() [2/4]

template<class Type >
constexpr BasicVector2D< Type > & operator= ( const BasicVector2D< Type > &  other)
constexprdefault

◆ operator=() [3/4]

template<class Type >
template<class RType >
constexpr BasicRef & operator= ( const BasicVector2D< RType > &  input)
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 51 of file Vector2D.hpp.

◆ operator=() [4/4]

template<class Type >
constexpr BasicVector2D< Type > & operator= ( Ref  other)
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 438 of file Vector2D.hpp.

◆ unit_x()

template<class Type >
static constexpr BasicVector2D< Type > unit_x ( )
inlinestaticconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 455 of file Vector2D.hpp.

◆ unit_y()

template<class Type >
static constexpr BasicVector2D< Type > unit_y ( )
inlinestaticconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 456 of file Vector2D.hpp.

◆ xx() [1/2]

template<class Type >
constexpr BasicVector2D xx ( )
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 485 of file Vector2D.hpp.

◆ xx() [2/2]

template<class Type >
constexpr BasicVector2D xx ( ) const
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 484 of file Vector2D.hpp.

◆ xy() [1/3]

template<class Type >
constexpr Ref xy ( ) &
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 491 of file Vector2D.hpp.

◆ xy() [2/3]

template<class Type >
constexpr BasicVector2D xy ( ) &&
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 492 of file Vector2D.hpp.

◆ xy() [3/3]

template<class Type >
constexpr ConstRef xy ( ) const &
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 490 of file Vector2D.hpp.

◆ yx() [1/3]

template<class Type >
constexpr Ref yx ( ) &
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 495 of file Vector2D.hpp.

◆ yx() [2/3]

template<class Type >
constexpr BasicVector2D yx ( ) &&
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 496 of file Vector2D.hpp.

◆ yx() [3/3]

template<class Type >
constexpr ConstRef yx ( ) const &
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 494 of file Vector2D.hpp.

◆ yy() [1/2]

template<class Type >
constexpr BasicVector2D yy ( )
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 488 of file Vector2D.hpp.

◆ yy() [2/2]

template<class Type >
constexpr BasicVector2D yy ( ) const
inlineconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 487 of file Vector2D.hpp.

◆ zero()

template<class Type >
static constexpr BasicVector2D< Type > zero ( )
inlinestaticconstexpr

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 458 of file Vector2D.hpp.

Variable Documentation

◆ x [1/2]

template<class Type >
template<class RType >
RType& x

Definition at line 150 of file Vector2D.hpp.

◆ x [2/2]

template<class Type >
Type x {}

Definition at line 503 of file Vector2D.hpp.

◆ y [1/2]

template<class Type >
template<class RType >
RType& y

Definition at line 151 of file Vector2D.hpp.

◆ y [2/2]

template<class Type >
Type y {}

Definition at line 504 of file Vector2D.hpp.

Friends

◆ abs [1/2]

template<class Type >
template<class RType >
constexpr BasicVector2D< RType > abs ( BasicRef< RType >  input)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 226 of file Vector2D.hpp.

◆ abs [2/2]

template<class Type >
constexpr BasicVector2D< Type > abs ( const BasicVector2D< Type > &  input)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Calculate the absolute value of all components of a BasicVector2D

Parameters
inputThe BasicVector2D to operate on
Returns
The BasicVector2D with only positive values

Definition at line 803 of file Vector2D.hpp.

◆ accumulate [1/2]

template<class Type >
template<class RType >
constexpr RType accumulate ( BasicRef< RType >  input)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 174 of file Vector2D.hpp.

◆ accumulate [2/2]

template<class Type >
constexpr Type accumulate ( const BasicVector2D< Type > &  input)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Sums up the components of input

@input The BasicVector2D to operate on

Definition at line 671 of file Vector2D.hpp.

◆ approximately_equal_to [1/4]

template<class Type >
template<class RType >
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<RType, U>
constexpr bool approximately_equal_to ( BasicRef< RType >  value_to_test,
BasicRef< U >  value_it_should_be,
OT  tolerance = OT{0.0002} 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 156 of file Vector2D.hpp.

◆ approximately_equal_to [2/4]

template<class Type >
template<class RType >
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<RType, U>
constexpr bool approximately_equal_to ( BasicRef< RType >  value_to_test,
const BasicVector2D< U > &  value_it_should_be,
OT  tolerance = OT{0.0002} 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 166 of file Vector2D.hpp.

◆ approximately_equal_to [3/4]

template<class Type >
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<Type, U>
constexpr bool approximately_equal_to ( const BasicVector2D< Type > &  value_to_test,
BasicRef< U >  value_it_should_be,
OT  tolerance = OT{0.0002} 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Compares two BasicVector2D inputs equal, component-wise, to within a tolerance

Parameters
value_to_test
value_it_should_be
toleranceHow close they should be to be considered equal
Returns
true if they are equal
See also
Equality

Definition at line 563 of file Vector2D.hpp.

◆ approximately_equal_to [4/4]

template<class Type >
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<Type, U>
constexpr bool approximately_equal_to ( const BasicVector2D< Type > &  value_to_test,
const BasicVector2D< U > &  value_it_should_be,
OT  tolerance = OT{0.0002} 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Compares two BasicVector2D inputs equal, component-wise, to within a tolerance

Parameters
value_to_test
value_it_should_be
toleranceHow close they should be to be considered equal
Returns
true if they are equal
See also
Equality

Definition at line 543 of file Vector2D.hpp.

◆ check_if_equal [1/2]

template<class Type >
template<class RType >
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<RType, U>
bool check_if_equal ( BasicRef< RType >  input,
BasicRef< U >  near_to,
OT  tolerance = OT{0.0002} 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 287 of file Vector2D.hpp.

◆ CHECK_IF_EQUAL [1/2]

template<class Type >
template<class RType >
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<RType, U>
void CHECK_IF_EQUAL ( BasicRef< RType >  input,
BasicRef< U >  near_to,
OT  tolerance = OT{0.0002} 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 371 of file Vector2D.hpp.

◆ check_if_equal [2/2]

template<class Type >
template<class RType >
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<RType, U>
bool check_if_equal ( BasicRef< RType >  input,
const BasicVector2D< U > &  near_to,
OT  tolerance = OT{0.0002} 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 308 of file Vector2D.hpp.

◆ CHECK_IF_EQUAL [2/2]

template<class Type >
template<class RType >
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<RType, U>
void CHECK_IF_EQUAL ( BasicRef< RType >  input,
const BasicVector2D< U > &  near_to,
OT  tolerance = OT{0.0002} 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 380 of file Vector2D.hpp.

◆ check_if_not_equal [1/2]

template<class Type >
template<class RType >
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<RType, U>
bool check_if_not_equal ( BasicRef< RType >  input,
BasicRef< RType >  near_to,
OT  tolerance = OT{0.0002} 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 329 of file Vector2D.hpp.

◆ CHECK_IF_NOT_EQUAL [1/2]

template<class Type >
template<class RType >
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<RType, U>
void CHECK_IF_NOT_EQUAL ( BasicRef< RType >  input,
BasicRef< U >  near_to,
OT  tolerance = OT{0.0002} 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 389 of file Vector2D.hpp.

◆ check_if_not_equal [2/2]

template<class Type >
template<class RType >
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<RType, U>
bool check_if_not_equal ( BasicRef< RType >  input,
const BasicVector2D< U > &  near_to,
OT  tolerance = OT{0.0002} 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 350 of file Vector2D.hpp.

◆ CHECK_IF_NOT_EQUAL [2/2]

template<class Type >
template<class RType >
template<class U , std::floating_point OT = float>
requires Concept::SameUnqualified<RType, U>
void CHECK_IF_NOT_EQUAL ( BasicRef< RType >  input,
const BasicVector2D< U > &  near_to,
OT  tolerance = OT{0.0002} 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 398 of file Vector2D.hpp.

◆ CHECK_IF_ZERO

template<class Type >
template<class RType >
template<std::floating_point OT = float>
void CHECK_IF_ZERO ( BasicRef< RType >  input,
OT  tolerance = OT{0.0002} 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 406 of file Vector2D.hpp.

◆ cross [1/4]

template<class Type >
template<class RType >
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr RType cross ( BasicRef< RType >  left,
BasicRef< U >  right 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 209 of file Vector2D.hpp.

◆ cross [2/4]

template<class Type >
template<class RType >
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr RType cross ( BasicRef< RType >  left,
const BasicVector2D< U > &  right 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 216 of file Vector2D.hpp.

◆ cross [3/4]

template<class Type >
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr Type cross ( const BasicVector2D< Type > &  left,
const BasicVector2D< U > &  right 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Calculates a pseudo cross product between two BasicVector2D objects

Parameters
leftThe first vector
rightThe second vector
Returns
A scalar value representing the 2D cross product
Note
Since the 3D version of cross product comes from the calculation of a determinant of a matrix, I define the same idea here but using a 2 x 2 matrix instead of the 3 x 3 3D for the version (also owing to the recursive nature of the calculation of a determinant).

Definition at line 773 of file Vector2D.hpp.

◆ cross [4/4]

template<class Type >
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr Type cross ( const BasicVector2D< Type > &  left,
BasicRef< U >  right 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Calculates a pseudo cross product between two BasicVector2D objects

Parameters
leftThe first vector
rightThe second vector
Returns
A scalar value representing the 2D cross product
Note
Since the 3D version of cross product comes from the calculation of a determinant of a matrix, I define the same idea here but using a 2 x 2 matrix instead of the 3 x 3 3D for the version (also owing to the recursive nature of the calculation of a determinant).

Definition at line 792 of file Vector2D.hpp.

◆ dot [1/4]

template<class Type >
template<class RType >
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr RType dot ( BasicRef< RType >  left,
BasicRef< U >  right 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 181 of file Vector2D.hpp.

◆ dot [2/4]

template<class Type >
template<class RType >
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr RType dot ( BasicRef< RType >  left,
const BasicVector2D< U > &  right 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 188 of file Vector2D.hpp.

◆ dot [3/4]

template<class Type >
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr Type dot ( const BasicVector2D< Type > &  left,
BasicRef< U >  right 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Calculate the dot product of two BasicVector2D objects

Parameters
leftThe first vector
rightThe second vector
Returns
The dot product of the two input vectors
Note
This is only a strict dot product and thus a normalized result will depend on if the input vectors are both normalized!

Definition at line 707 of file Vector2D.hpp.

◆ dot [4/4]

template<class Type >
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr Type dot ( const BasicVector2D< Type > &  left,
const BasicVector2D< U > &  right 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Calculate the dot product of two BasicVector2D objects

Parameters
leftThe first vector
rightThe second vector
Returns
The dot product of the two input vectors
Note
This is only a strict dot product and thus a normalized result will depend on if the input vectors are both normalized!

Definition at line 689 of file Vector2D.hpp.

◆ dot_normalized [1/4]

template<class Type >
template<class RType >
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr RType dot_normalized ( BasicRef< RType >  left,
BasicRef< U >  right 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 195 of file Vector2D.hpp.

◆ dot_normalized [2/4]

template<class Type >
template<class RType >
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr RType dot_normalized ( BasicRef< RType >  left,
const BasicVector2D< U > &  right 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 202 of file Vector2D.hpp.

◆ dot_normalized [3/4]

template<class Type >
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr Type dot_normalized ( const BasicVector2D< Type > &  left,
BasicRef< U >  right 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Calculate the normalized dot product of two BasicVector2D objects

The input vectors are not assumed to be normalized, so we go ahead and divide through by both the input vectors to arrive at a normalized output.

Parameters
leftThe first vector
rightThe second vector
Returns
The dot product of the two input vectors

Definition at line 743 of file Vector2D.hpp.

◆ dot_normalized [4/4]

template<class Type >
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr Type dot_normalized ( const BasicVector2D< Type > &  left,
const BasicVector2D< U > &  right 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Calculate the normalized dot product of two BasicVector2D objects

The input vectors are not assumed to be normalized, so we go ahead and divide through by both the input vectors to arrive at a normalized output.

Parameters
leftThe first vector
rightThe second vector
Returns
The dot product of the two input vectors

Definition at line 725 of file Vector2D.hpp.

◆ format [1/2]

template<class Type >
template<class RType >
std::string format ( BasicRef< RType >  input)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 280 of file Vector2D.hpp.

◆ format [2/2]

template<class Type >
std::string format ( const BasicVector2D< Type > &  input)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 861 of file Vector2D.hpp.

◆ fract [1/2]

template<class Type >
template<class RType >
constexpr BasicVector2D< RType > fract ( BasicRef< RType >  input)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 231 of file Vector2D.hpp.

◆ fract [2/2]

template<class Type >
constexpr BasicVector2D< Type > fract ( const BasicVector2D< Type > &  input)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Calculate the fractional part of all components of a BasicVector2D

Parameters
inputThe BasicVector2D to operate on
Returns
The BasicVector2D with only fractional values

Definition at line 814 of file Vector2D.hpp.

◆ lerp [1/4]

template<class Type >
template<class RType >
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > lerp ( BasicRef< RType >  input_lower_bound,
BasicRef< U >  input_upper_bound,
float  percentage_zero_to_one 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 246 of file Vector2D.hpp.

◆ lerp [2/4]

template<class Type >
template<class RType >
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > lerp ( BasicRef< RType >  input_lower_bound,
const BasicVector2D< U > &  input_upper_bound,
float  percentage_zero_to_one 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 255 of file Vector2D.hpp.

◆ lerp [3/4]

template<class Type >
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr BasicVector2D< Type > lerp ( const BasicVector2D< Type > &  input_lower_bound,
BasicRef< U >  input_upper_bound,
float  percentage_zero_to_one 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 836 of file Vector2D.hpp.

◆ lerp [4/4]

template<class Type >
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr BasicVector2D< Type > lerp ( const BasicVector2D< Type > &  input_lower_bound,
const BasicVector2D< U > &  input_upper_bound,
float  percentage_zero_to_one 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 827 of file Vector2D.hpp.

◆ mix [1/4]

template<class Type >
template<class RType >
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > mix ( BasicRef< RType >  input_lower_bound,
BasicRef< U >  input_upper_bound,
float  percentage_zero_to_one 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 264 of file Vector2D.hpp.

◆ mix [2/4]

template<class Type >
template<class RType >
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > mix ( BasicRef< RType >  input_lower_bound,
const BasicVector2D< U > &  input_upper_bound,
float  percentage_zero_to_one 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 273 of file Vector2D.hpp.

◆ mix [3/4]

template<class Type >
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr BasicVector2D< Type > mix ( const BasicVector2D< Type > &  input_lower_bound,
BasicRef< U >  input_upper_bound,
float  percentage_zero_to_one 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 854 of file Vector2D.hpp.

◆ mix [4/4]

template<class Type >
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr BasicVector2D< Type > mix ( const BasicVector2D< Type > &  input_lower_bound,
const BasicVector2D< U > &  input_upper_bound,
float  percentage_zero_to_one 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 845 of file Vector2D.hpp.

◆ normalized [1/2]

template<class Type >
template<class RType >
constexpr BasicVector2D< RType > normalized ( BasicRef< RType >  input)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 221 of file Vector2D.hpp.

◆ normalized [2/2]

template<class Type >
constexpr BasicVector2D< Type > normalized ( const BasicVector2D< Type > &  input)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Creates the normalized form of a BasicVector2D

Parameters
inputThe BasicVector2D to normalize
Returns
The normalized version of input

Definition at line 754 of file Vector2D.hpp.

◆ operator* [1/4]

template<class Type >
template<class RType >
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > operator* ( BasicRef< RType >  left,
BasicRef< U >  right 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 100 of file Vector2D.hpp.

◆ operator* [2/4]

template<class Type >
template<class RType >
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > operator* ( BasicRef< RType >  left,
const BasicVector2D< U > &  right 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 107 of file Vector2D.hpp.

◆ operator* [3/4]

template<class Type >
template<class RType >
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > operator* ( BasicRef< RType >  left,
const U &  scalar 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 114 of file Vector2D.hpp.

◆ operator* [4/4]

template<class Type >
template<class RType >
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > operator* ( const U &  scalar,
BasicRef< RType >  right 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 121 of file Vector2D.hpp.

◆ operator+ [1/2]

template<class Type >
template<class RType >
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > operator+ ( BasicRef< RType >  left,
BasicRef< U >  right 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 72 of file Vector2D.hpp.

◆ operator+ [2/2]

template<class Type >
template<class RType >
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > operator+ ( BasicRef< RType >  left,
const BasicVector2D< U > &  right 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 79 of file Vector2D.hpp.

◆ operator- [1/2]

template<class Type >
template<class RType >
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > operator- ( BasicRef< RType >  left,
BasicRef< U >  right 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 86 of file Vector2D.hpp.

◆ operator- [2/2]

template<class Type >
template<class RType >
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > operator- ( BasicRef< RType >  left,
const BasicVector2D< U > &  right 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 93 of file Vector2D.hpp.

◆ operator/ [1/3]

template<class Type >
template<class RType >
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > operator/ ( BasicRef< RType >  left,
BasicRef< U >  right 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 128 of file Vector2D.hpp.

◆ operator/ [2/3]

template<class Type >
template<class RType >
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > operator/ ( BasicRef< RType >  left,
const BasicVector2D< U > &  right 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 135 of file Vector2D.hpp.

◆ operator/ [3/3]

template<class Type >
template<class RType >
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr BasicVector2D< RType > operator/ ( BasicRef< RType >  left,
U  scalar 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 142 of file Vector2D.hpp.

◆ operator== [1/3]

template<class Type >
template<class RType >
constexpr bool operator== ( BasicRef< RType >  left,
BasicRef< U >  right 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 58 of file Vector2D.hpp.

◆ operator== [2/3]

template<class Type >
template<class RType >
template<class U >
requires Concept::SameUnqualified<RType, U>
constexpr bool operator== ( BasicRef< RType >  left,
const BasicVector2D< U > &  right 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 65 of file Vector2D.hpp.

◆ operator== [3/3]

template<class Type >
template<class U >
requires Concept::SameUnqualified<Type, U>
constexpr bool operator== ( const BasicVector2D< Type > &  left,
const BasicVector2D< U > &  right 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Defines equality of two BasicVector2D objects

Note
Uses approximately_equal_to under-the-hood
We take advantage of new C++20 rules that can automatically generate the operator !=() from the operator ==().
See also
Equality

Definition at line 526 of file Vector2D.hpp.

◆ saturate [1/2]

template<class Type >
template<class RType >
constexpr BasicVector2D< RType > saturate ( BasicRef< RType >  input,
RType  lower_bound,
RType  upper_bound 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 238 of file Vector2D.hpp.

◆ saturate [2/2]

template<class Type >
constexpr BasicVector2D< Type > saturate ( const BasicVector2D< Type > &  input,
const Type  lower_bound,
Type  upper_bound 
)
friend

#include <lib/include/Math/math/Vector2D.hpp>

Definition at line 819 of file Vector2D.hpp.