|
| | Vector2D (const double x, const double y) |
| | Initializes a vector given xy components. More...
|
| |
|
| Vector2D (const Vec2_ &other) |
| | Copy constructor for base class.
|
| |
| double | x () const |
| | Gets x-component. More...
|
| |
| void | x (const double &newX) |
| | Sets x-component. More...
|
| |
| double | y () const |
| | Gets y-component. More...
|
| |
| void | y (const double &newY) |
| | Sets y-component. More...
|
| |
| double | angle () const |
| | Angle of vector. More...
|
| |
| Vector2D | rotate (const double ang) const |
| | Rotates vector by a certain angle. More...
|
| |
| template<typename T > |
| T | componentsAs () const |
| | Converts vector to another object. More...
|
| |
| | Vector () |
| | No-argument constructor. More...
|
| |
| | Vector (const std::initializer_list< T > args) |
| | Initializes a vector given initializer list. More...
|
| |
| | Vector (const Vector< D, T > &other) |
| | Copy constructor. More...
|
| |
| | Vector (Vector< D, T > &&) noexcept=default |
| | Move constructor. More...
|
| |
| | Vector () |
| | No-argument constructor. More...
|
| |
| | Vector (const std::initializer_list< T > args) |
| | Initializes a vector given initializer list. More...
|
| |
| | Vector (const Vector< D, T > &other) |
| | Copy constructor. More...
|
| |
| | Vector (Vector< D, T > &&) noexcept=default |
| | Move constructor. More...
|
| |
| Vector< D, T > & | operator= (const Vector< D, T > &other) |
| | Assignment operator. More...
|
| |
| Vector< D, T > & | operator= (Vector< D, T > &&) noexcept=default |
| | Move assignment operator. More...
|
| |
| virtual | ~Vector ()=default |
| | Destructor. More...
|
| |
| virtual std::string | toString () const |
| | Returns string form of vector. More...
|
| |
| Vector< D, T > | operator- () const |
| | Negative of a vector. More...
|
| |
| Vector< D, T > | operator+ () const |
| | Positive of a vector. More...
|
| |
| Vector< D, T > & | operator+= (const Vector< D, T > &other) |
| | In-place addition. More...
|
| |
| Vector< D, T > & | operator-= (const Vector< D, T > &other) |
| | In-place subtraction. More...
|
| |
| Vector< D, T > & | operator*= (const T other) |
| | In-place scalar multiplication. More...
|
| |
| Vector< D, T > & | operator/= (const T other) |
| | In-place scalar division. More...
|
| |
| T | dot (const Vector< D, T > &other) const |
| | Dot product. More...
|
| |
| T | magn () const |
| | Magnitude. More...
|
| |
| Vector< D, T > | normalize () const |
| | Normalizes a vector. More...
|
| |
| constexpr std::size_t | numDimensions () const |
| | Gets the number of dimensions. More...
|
| |
| bool | isZero () const |
| | Determines whether the current vector is a zero vector. More...
|
| |
| const T & | operator[] (const std::size_t index) const |
| | Value of a certain component of a vector. More...
|
| |
| T & | operator[] (const std::size_t index) |
| | Sets value of a certain component. More...
|
| |
| const T & | at (const std::size_t index) const |
| | Value of a certain component of a vector. More...
|
| |
| T & | at (const std::size_t index) |
| | Sets value of a certain component. More...
|
| |
| iterator | begin () noexcept |
| | Iterator of first element. More...
|
| |
| const_iterator | begin () const noexcept |
| | Const interator of first element. More...
|
| |
| iterator | end () noexcept |
| | Interator of last element + 1. More...
|
| |
| const_iterator | end () const noexcept |
| | Const interator of last element + 1. More...
|
| |
| reverse_iterator | rbegin () noexcept |
| | Reverse iterator to last element. More...
|
| |
| const_reverse_iterator | rbegin () const noexcept |
| | Const reverse iterator to last element. More...
|
| |
| reverse_iterator | rend () noexcept |
| | Reverse iterator to first element - 1. More...
|
| |
| const_reverse_iterator | rend () const noexcept |
| | Const reverse iterator to first element - 1. More...
|
| |
A simple 2D vector representation.