template<typename T, int N>
requires std::integral<T> || std::floating_point<T>
struct tz::vector< T, N >
Represents the generic vector.
|
template<typename... Ts>
requires ( sizeof...(Ts) <= N && sizeof...(Ts) > 1 && std::is_convertible_v<std::tuple_element_t<0, std::tuple<Ts...>>, T>) |
constexpr | vector (Ts &&... ts) |
|
constexpr | vector (std::array< T, N > data) |
|
| vector ()=default |
|
const T & | operator[] (std::size_t idx) const |
|
T & | operator[] (std::size_t idx) |
|
vector< T, N > & | operator+= (const vector< T, N > &rhs) |
| Add one vector to another.
|
|
vector< T, N > & | operator-= (const vector< T, N > &rhs) |
| Subtract one vector from another.
|
|
vector< T, N > & | operator*= (const vector< T, N > &rhs) |
| Multiply one vector with another.
|
|
vector< T, N > & | operator/= (const vector< T, N > &rhs) |
| Divide one vector by another.
|
|
vector< T, N > | operator+ (const vector< T, N > &rhs) const |
| Add one vector to another.
|
|
vector< T, N > | operator- (const vector< T, N > &rhs) const |
| Subtract one vector from another.
|
|
vector< T, N > | operator* (const vector< T, N > &rhs) const |
| Multiply one vector with another.
|
|
vector< T, N > | operator/ (const vector< T, N > &rhs) const |
| Divide one vector by another.
|
|
T | length () const |
| Retrieve the magnitude of the vector.
|
|
T | dot (const vector< T, N > &rhs) const |
| Retrieve the dot (scalar) product of two vectors.
|
|
vector< T, N > | cross (const vector< T, N > &rhs) const |
| Retrieve a cross product between two three-dimensional vectors.
|
|
bool | operator== (const vector< T, N > &rhs) const =default |
| Compare two vectors. Two vectors are equal if all of their components are exactly equal.
|
|
template<typename T , int N>
template<typename... Ts>
requires ( sizeof...(Ts) <= N && sizeof...(Ts) > 1 && std::is_convertible_v<std::tuple_element_t<0, std::tuple<Ts...>>, T>)
Construct a vector directly using a variadic parameter pack value. If the number of parameters provided is less than the vector's length, the remainder elements of the vector will be of indeterminate value.