Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
Operators

Functions

Vector2< T > donner::Vector2< T >::operator- () const
 Unary negation.
 
Vector2< T > donner::Vector2< T >::operator+ (const Vector2< T > &rhs) const
 Addition operator, add two vectors and return the result.
 
Vector2< T > & donner::Vector2< T >::operator+= (const Vector2< T > &rhs)
 Addition assignment operator, add rhs to this vector.
 
Vector2< T > donner::Vector2< T >::operator- (const Vector2< T > &rhs) const
 Subtraction operator, subtract two vectors and return the result.
 
Vector2< T > & donner::Vector2< T >::operator-= (const Vector2< T > &rhs)
 Subtraction assignment operator, subtract rhs from this vector.
 
Vector2< T > donner::Vector2< T >::operator* (const Vector2< T > &rhs) const
 Piecewise multiplication operator, multiply the x and y components of two vectors and return the result.
 
Vector2< T > & donner::Vector2< T >::operator*= (const Vector2< T > &rhs)
 Piecewise multiplication assignment operator, multiply the x and y components of this vector by the x and y components of rhs.
 
Vector2< T > donner::Vector2< T >::operator* (const T a) const
 Scalar multiplication operator, multiply the x and y components of this vector by a and return the result.
 
Vector2< T > & donner::Vector2< T >::operator*= (const T a)
 Scalar multiplication assignment operator, multiply the x and y components of this vector by a.
 
Vector2< T > donner::Vector2< T >::operator/ (const Vector2< T > &rhs) const
 Piecewise division operator, divide the x and y components of two vectors and return the result.
 
Vector2< T > & donner::Vector2< T >::operator/= (const Vector2< T > &rhs)
 Piecewise division assignment operator, divide the x and y components of this vector by the x and y components of rhs.
 
Vector2< T > donner::Vector2< T >::operator/ (const T a) const
 Scalar division operator, divide the x and y components of this vector by a and return the result.
 
Vector2< T > & donner::Vector2< T >::operator/= (const T a)
 Scalar division assignment operator, divide the x and y components of this vector by a.
 
bool donner::Vector2< T >::operator== (const Vector2< T > &other) const
 Equality operator, check if two vectors are equal.
 
bool donner::Vector2< T >::operator!= (const Vector2< T > &rhs) const
 Inequality operator, check if two vectors are not equal.
 
template<typename U >
bool donner::Vector2< T >::operator== (const Vector2< U > &other) const
 Equality operator with a vector of a different type, check if two vectors are equal.
 
template<typename U >
bool donner::Vector2< T >::operator!= (const Vector2< U > &rhs) const
 Inequality operator with a vector of a different type, check if two vectors are not equal.
 

Friends

Vector2< T > donner::Vector2< T >::operator* (const T a, const Vector2< T > &other)
 Reversed scalar multiplication operator, multiply the x and y components of this vector by a and return the result.
 
Vector2< T > donner::Vector2< T >::operator/ (const T a, const Vector2< T > &other)
 Reversed scalar division operator, divide the x and y components of this vector by a and return the result.
 

Detailed Description

Function Documentation

◆ operator!=() [1/2]

template<typename T >
bool donner::Vector2< T >::operator!= ( const Vector2< T > & rhs) const
inline

Inequality operator, check if two vectors are not equal.

Parameters
rhsThe vector to compare.

◆ operator!=() [2/2]

template<typename T >
template<typename U >
bool donner::Vector2< T >::operator!= ( const Vector2< U > & rhs) const
inline

Inequality operator with a vector of a different type, check if two vectors are not equal.

Parameters
rhsThe vector to compare.

◆ operator*() [1/2]

template<typename T >
Vector2< T > donner::Vector2< T >::operator* ( const T a) const
inline

Scalar multiplication operator, multiply the x and y components of this vector by a and return the result.

Equivalent to Vector2<T>(lhs.x * a, lhs.y * a).

Parameters
aThe scalar to multiply.

◆ operator*() [2/2]

template<typename T >
Vector2< T > donner::Vector2< T >::operator* ( const Vector2< T > & rhs) const
inline

Piecewise multiplication operator, multiply the x and y components of two vectors and return the result.

Equivalent to Vector2<T>(lhs.x * rhs.x, lhs.y * rhs.y).

Parameters
rhsThe vector to multiply.

◆ operator*=() [1/2]

template<typename T >
Vector2< T > & donner::Vector2< T >::operator*= ( const T a)
inline

Scalar multiplication assignment operator, multiply the x and y components of this vector by a.

Equivalent to lhs.x *= a; lhs.y *= a;.

Parameters
aThe scalar to multiply.

◆ operator*=() [2/2]

template<typename T >
Vector2< T > & donner::Vector2< T >::operator*= ( const Vector2< T > & rhs)
inline

Piecewise multiplication assignment operator, multiply the x and y components of this vector by the x and y components of rhs.

Equivalent to lhs.x *= rhs.x; lhs.y *= rhs.y;.

Parameters
rhsThe vector to multiply.

◆ operator+()

template<typename T >
Vector2< T > donner::Vector2< T >::operator+ ( const Vector2< T > & rhs) const
inline

Addition operator, add two vectors and return the result.

Parameters
rhsThe vector to add.

◆ operator+=()

template<typename T >
Vector2< T > & donner::Vector2< T >::operator+= ( const Vector2< T > & rhs)
inline

Addition assignment operator, add rhs to this vector.

Parameters
rhsThe vector to add.

◆ operator-()

template<typename T >
Vector2< T > donner::Vector2< T >::operator- ( const Vector2< T > & rhs) const
inline

Subtraction operator, subtract two vectors and return the result.

Parameters
rhsThe vector to subtract.

◆ operator-=()

template<typename T >
Vector2< T > & donner::Vector2< T >::operator-= ( const Vector2< T > & rhs)
inline

Subtraction assignment operator, subtract rhs from this vector.

Parameters
rhsThe vector to subtract.

◆ operator/() [1/2]

template<typename T >
Vector2< T > donner::Vector2< T >::operator/ ( const T a) const
inline

Scalar division operator, divide the x and y components of this vector by a and return the result.

Equivalent to Vector2<T>(lhs.x / a, lhs.y / a).

Parameters
aThe scalar to divide.

◆ operator/() [2/2]

template<typename T >
Vector2< T > donner::Vector2< T >::operator/ ( const Vector2< T > & rhs) const
inline

Piecewise division operator, divide the x and y components of two vectors and return the result.

Equivalent to Vector2<T>(lhs.x / rhs.x, lhs.y / rhs.y).

Parameters
rhsThe vector to divide.

◆ operator/=() [1/2]

template<typename T >
Vector2< T > & donner::Vector2< T >::operator/= ( const T a)
inline

Scalar division assignment operator, divide the x and y components of this vector by a.

Equivalent to lhs.x /= a; lhs.y /= a;.

Parameters
aThe scalar to divide.

◆ operator/=() [2/2]

template<typename T >
Vector2< T > & donner::Vector2< T >::operator/= ( const Vector2< T > & rhs)
inline

Piecewise division assignment operator, divide the x and y components of this vector by the x and y components of rhs.

Equivalent to lhs.x /= rhs.x; lhs.y /= rhs.y;.

Parameters
rhsThe vector to divide.

◆ operator==() [1/2]

template<typename T >
bool donner::Vector2< T >::operator== ( const Vector2< T > & other) const
inline

Equality operator, check if two vectors are equal.

Parameters
otherThe vector to compare.

◆ operator==() [2/2]

template<typename T >
template<typename U >
bool donner::Vector2< T >::operator== ( const Vector2< U > & other) const
inline

Equality operator with a vector of a different type, check if two vectors are equal.

Parameters
otherThe vector to compare.

Friends

◆ operator*

template<typename T >
Vector2< T > operator* ( const T a,
const Vector2< T > & other )
friend

Reversed scalar multiplication operator, multiply the x and y components of this vector by a and return the result.

Equivalent to Vector2<T>(a * lhs.x, a * lhs.y).

Parameters
aThe scalar to multiply.
otherThe vector to multiply.

◆ operator/

template<typename T >
Vector2< T > operator/ ( const T a,
const Vector2< T > & other )
friend

Reversed scalar division operator, divide the x and y components of this vector by a and return the result.

Equivalent to Vector2<T>(a / lhs.x, a / lhs.y).

Parameters
aThe scalar to divide.
otherThe vector to divide.