#include <multiplierless/vector2.hpp>
template<typename T1, typename T2 = T1>
vector2 class
Contents
Constructors, destructors, conversion operators
Public functions
- auto _tie() const -> auto
- auto x() const noexcept -> const T1 & -> auto constexpr
- auto y() const noexcept -> const T2 & -> auto constexpr
-
template<typename U1, typename U2>auto dot(const vector2<U1, U2>& other) const -> auto constexpr
-
template<typename U1, typename U2>auto cross(const vector2<U1, U2>& other) const -> auto constexpr
Public variables
Comparison operators
definie ==, !=, <, >, <=, >=.
-
template<typename U1, typename U2>auto operator==(const vector2<U1, U2>& other) const -> bool -> auto constexpr
- Equal to.
-
template<typename U1, typename U2>auto operator<(const vector2<U1, U2>& other) const -> bool -> auto constexpr
- Less than.
-
template<typename U1, typename U2>auto operator!=(const vector2<U1, U2>& other) const -> bool -> auto constexpr
- Not equal to.
-
template<typename U1, typename U2>auto operator>(const vector2<U1, U2>& other) const -> bool -> auto constexpr
- Greater than.
-
template<typename U1, typename U2>auto operator<=(const vector2<U1, U2>& other) const -> bool -> auto constexpr
- Less than or euqual to.
-
template<typename U1, typename U2>auto operator>=(const vector2<U1, U2>& other) const -> bool -> auto constexpr
- Greater than or equal to.
Arithmetic operators
definie +, -, *, /, +=, -=, *=, /=, etc.
- auto operator-() const -> vector2 -> auto constexpr
- Negate.
-
template<typename U1, typename U2>auto operator+=(const vector2<U1, U2>& other) -> vector2 & -> auto constexpr
- Add.
-
template<typename U1, typename U2>auto operator-=(const vector2<U1, U2>& other) -> vector2 & -> auto constexpr
- Substract.
-
template<typename R>auto operator*=(const R& alpha) -> vector2 & -> auto constexpr
- Multiply.
-
template<typename R>auto operator/=(const R& alpha) -> vector2 & -> auto constexpr
- Divide.
-
template<typename U1, typename U2>auto operator+(vector2 x, const vector2<U1, U2>& y) -> vector2 -> friend auto constexpr
- Add.
-
template<typename U1, typename U2>auto operator-(vector2 x, const vector2<U1, U2>& y) -> vector2 -> friend auto constexpr
- Substract.
-
template<typename R>auto operator*(vector2 x, const R& alpha) -> vector2 -> friend auto constexpr
- Multiply by a scalar.
-
template<typename R>auto operator*(const R& alpha, vector2 x) -> vector2 -> friend auto constexpr
- Multiply (by a scalar)
-
template<typename R>auto operator/(vector2 x, const R& alpha) -> vector2 -> friend auto constexpr
- Divide (by a scalar)
Friends
-
template<class Stream>auto operator<<(Stream& out, const vector2& v) -> Stream & -> auto
Function documentation
template<typename T1, typename T2>
auto numeric:: vector2<T1, T2>:: x() const noexcept -> const T1 & constexpr
Returns | constexpr const T1& |
---|
template<typename T1, typename T2>
auto numeric:: vector2<T1, T2>:: y() const noexcept -> const T2 & constexpr
Returns | constexpr const T2& |
---|
template<typename T1, typename T2>
template<typename U1, typename U2>
auto numeric:: vector2<T1, T2>:: operator==(const vector2<U1, U2>& other) const -> bool constexpr
Equal to.
Template parameters | |
---|---|
U1 | |
U2 | |
Parameters | |
other in | |
Returns | true |
template<typename T1, typename T2>
template<typename U1, typename U2>
auto numeric:: vector2<T1, T2>:: operator!=(const vector2<U1, U2>& other) const -> bool constexpr
Not equal to.
Template parameters | |
---|---|
U1 | |
U2 | |
Parameters | |
other in | |
Returns | true |
template<typename T1, typename T2>
template<typename U1, typename U2>
auto numeric:: vector2<T1, T2>:: operator<=(const vector2<U1, U2>& other) const -> bool constexpr
Less than or euqual to.
Template parameters | |
---|---|
U1 | |
U2 | |
Parameters | |
other in | |
Returns | true |
template<typename T1, typename T2>
template<typename U1, typename U2>
auto numeric:: vector2<T1, T2>:: operator>=(const vector2<U1, U2>& other) const -> bool constexpr
Greater than or equal to.
Template parameters | |
---|---|
U1 | |
U2 | |
Parameters | |
other in | |
Returns | true |
template<typename T1, typename T2>
template<typename U1, typename U2>
auto numeric:: vector2<T1, T2>:: operator+=(const vector2<U1, U2>& other) -> vector2 & constexpr
Add.
Template parameters | |
---|---|
U1 | |
U2 | |
Parameters | |
other in | |
Returns | vector2& |
template<typename T1, typename T2>
template<typename U1, typename U2>
auto numeric:: vector2<T1, T2>:: operator-=(const vector2<U1, U2>& other) -> vector2 & constexpr
Substract.
Template parameters | |
---|---|
U1 | |
U2 | |
Parameters | |
other in | |
Returns | vector2& |
template<typename T1, typename T2>
template<typename R>
auto numeric:: vector2<T1, T2>:: operator*=(const R& alpha) -> vector2 & constexpr
Multiply.
Template parameters | |
---|---|
R | |
Parameters | |
alpha in | |
Returns | vector2& |
template<typename T1, typename T2>
template<typename R>
auto numeric:: vector2<T1, T2>:: operator/=(const R& alpha) -> vector2 & constexpr
Divide.
Template parameters | |
---|---|
R | |
Parameters | |
alpha in | |
Returns | vector2& |
template<typename T1, typename T2>
template<class Stream>
auto operator<<(Stream& out,
const vector2& v) -> Stream &
Template parameters | |
---|---|
Stream | |
Parameters | |
out out | |
v in | |
Returns | Stream& |