linear_algebra.hpp file
Basic linear algebra utilities for vectors and matrices.
This header provides simple vector and matrix classes for basic linear algebra operations. These are lightweight implementations designed specifically for the ellalgo library.
Classes
Functions
-
template<typename T>auto operator+(Vector2<T> lhs, const Vector2<T>& rhs) -> Vector2<T>
-
template<typename T>auto operator-(Vector2<T> lhs, const Vector2<T>& rhs) -> Vector2<T>
-
template<typename T>auto operator*(Vector2<T> v, T scalar) -> Vector2<T>
-
template<typename T>auto operator*(T scalar, Vector2<T> v) -> Vector2<T>
Function documentation
template<typename T>
Vector2<T> operator+(Vector2<T> lhs,
const Vector2<T>& rhs)
| Parameters | |
|---|---|
| lhs | The Vector2 to add the elements of the given Vector2 to. |
| rhs | The Vector2 to add to the elements of the given Vector2. |
| Returns | The resulting Vector2 after the addition. |
Adds the elements of the given Vector2 to the corresponding elements of this Vector2.
template<typename T>
Vector2<T> operator-(Vector2<T> lhs,
const Vector2<T>& rhs)
| Parameters | |
|---|---|
| lhs | The Vector2 to subtract the elements of the given Vector2 from. |
| rhs | The Vector2 to subtract from the elements of the given Vector2. |
| Returns | The resulting Vector2 after the subtraction. |
Subtracts the elements of the given Vector2 from the corresponding elements of this Vector2.