#include <Vector2.hpp>
Inherits Vector< T >.

Public Member Functions | |
| Vector2 (void) | |
| Default constructor Create a 2 Vector. | |
| Vector2 (const Vector2< T > &v) | |
| Copy constructor Create a Vector by copying the input Vector. | |
| Vector2 (const Vector2< T > *v) | |
| Copy constructor Create a Vector by copying the input Vector. | |
| Vector2 (const T &d1, const T &d2) | |
| Create a 2 Vector Create a 2 Vector and use the value d1, d2 to set the data of the Vector. | |
| Vector2 (const T &d) | |
| Create a 2 Vector Create a 2 Vector and use the value d to set the data of the Vector. | |
| Vector2 (const T *a) | |
| create a 2 Vector create a 2 Vector and set data by using the values array d | |
| Vector2 (const Vector< T > &v) | |
| Create a 2 Vector from a generic vector of size 2. | |
| ~Vector2 (void) | |
| Destructor. | |
| T & | x (void) |
| Return x coordinate reference. | |
| const T & | x (void) const |
| Return x coordinate reference. | |
| T & | y (void) |
| Return y coordinate reference. | |
| const T & | y (void) const |
| Return y coordinate reference. | |
| Vector2< T > & | normalize (void) |
| Normalize the vector Divide each elements of this vector its norm. | |
| Vector2< T > | getNormalized (void) const |
| Normalize a copy of the vector. | |
| T | operator* (const Vector2< T > &v) const |
| Multiplies the Vector with a vector3 (dot product). | |
| T | dot (const Vector2< T > &v) const |
| dot product | |
| Vector2< T > & | operator= (const Vector2< T > &v) |
| copy the value of the argument vector2 to this vector | |
| Vector2< T > | operator+ (const Vector2< T > &v) const |
| adds two vectors | |
| Vector2< T > | operator- (const Vector2< T > &v) const |
| subtracts two vectors | |
| Vector2< T > | operator/ (const T &d) const |
| Divides the Vector2 by a value. | |
| Vector2< T > | operator* (const T &d) const |
| Multiplies the Vector with a value. | |
| Vector2< T > | operator- (void) const |
| Compute opposite of the Vector. | |
| Vector2< T > & | operator+= (const Vector2< T > &v) |
| Adds the Vector2 with a Vector. | |
| Vector2< T > & | operator-= (const Vector2< T > &v) |
| Subtracts the Vector2 with a Vector. | |
| Vector2< T > & | operator/= (const T &d) |
| Divides the Vector2 with a value All values of the Vector2 are divided by d. | |
| Vector2< T > & | operator*= (const T &d) |
| Multiplies the Vector2 with a value. | |
| size_t | size (void) const |
| Returns the number of rows of the Vector. | |
| void | fill (const T &d) |
| Sets the value d on every entry of the vector. | |
| void | setZero (void) |
| Reset the vector entries to zero. | |
Definition at line 36 of file Vector2.hpp.
| kn::Vector2< T >::Vector2 | ( | void | ) | [inline] |
| kn::Vector2< T >::Vector2 | ( | const Vector2< T > & | v | ) | [inline] |
Copy constructor Create a Vector by copying the input Vector.
| v | the Vector to copy |
Definition at line 51 of file Vector2.hpp.
| kn::Vector2< T >::Vector2 | ( | const Vector2< T > * | v | ) | [inline] |
Copy constructor Create a Vector by copying the input Vector.
| v | the pointer to the Vector to copy |
| MathException | pointer is null |
Definition at line 287 of file Vector2.hpp.
| kn::Vector2< T >::Vector2 | ( | const T & | d1, | |
| const T & | d2 | |||
| ) | [inline] |
| kn::Vector2< T >::Vector2 | ( | const T & | d | ) | [inline, explicit] |
| kn::Vector2< T >::Vector2 | ( | const T * | a | ) | [inline] |
create a 2 Vector create a 2 Vector and set data by using the values array d
| a | pointer to an array of data |
| MathException | d is null |
Definition at line 294 of file Vector2.hpp.
| kn::Vector2< T >::Vector2 | ( | const Vector< T > & | v | ) | [inline] |
Create a 2 Vector from a generic vector of size 2.
| v | a vector |
| MathException | size of vector is different of 2 |
Definition at line 279 of file Vector2.hpp.
| kn::Vector2< T >::~Vector2 | ( | void | ) | [inline] |
| T kn::Vector2< T >::dot | ( | const Vector2< T > & | v | ) | const [inline] |
dot product
| v | the Vector used for the dot product |
| MathException | incompatible vector size |
Definition at line 170 of file Vector2.hpp.
| void kn::Vector2< T >::fill | ( | const T & | d | ) | [inline] |
Sets the value d on every entry of the vector.
Reimplemented from kn::Vector< T >.
Definition at line 265 of file Vector2.hpp.
| Vector2< T > kn::Vector2< T >::getNormalized | ( | void | ) | const [inline] |
Normalize a copy of the vector.
Reimplemented from kn::Vector< T >.
Definition at line 310 of file Vector2.hpp.
| Vector2< T > & kn::Vector2< T >::normalize | ( | void | ) | [inline] |
Normalize the vector Divide each elements of this vector its norm.
Reimplemented from kn::Vector< T >.
Definition at line 302 of file Vector2.hpp.
| Vector2<T> kn::Vector2< T >::operator* | ( | const T & | d | ) | const [inline] |
Multiplies the Vector with a value.
| d | the value multiplied with this Vector |
Reimplemented from kn::Vector< T >.
Definition at line 211 of file Vector2.hpp.
| T kn::Vector2< T >::operator* | ( | const Vector2< T > & | v | ) | const [inline] |
Multiplies the Vector with a vector3 (dot product).
| v | the vector3 multiplied with this Vector |
Definition at line 317 of file Vector2.hpp.
| Vector2< T > & kn::Vector2< T >::operator*= | ( | const T & | d | ) | [inline] |
Multiplies the Vector2 with a value.
| d | the value multiplied with this Vector2 |
Reimplemented from kn::Vector< T >.
Definition at line 370 of file Vector2.hpp.
| Vector2< T > kn::Vector2< T >::operator+ | ( | const Vector2< T > & | v | ) | const [inline] |
adds two vectors
| v | the vector to be added |
Definition at line 332 of file Vector2.hpp.
| Vector2< T > & kn::Vector2< T >::operator+= | ( | const Vector2< T > & | v | ) | [inline] |
| Vector2<T> kn::Vector2< T >::operator- | ( | void | ) | const [inline] |
Compute opposite of the Vector.
Reimplemented from kn::Vector< T >.
Definition at line 219 of file Vector2.hpp.
| Vector2< T > kn::Vector2< T >::operator- | ( | const Vector2< T > & | v | ) | const [inline] |
subtracts two vectors
| v | the vector to be substracted |
Definition at line 341 of file Vector2.hpp.
| Vector2< T > & kn::Vector2< T >::operator-= | ( | const Vector2< T > & | v | ) | [inline] |
| Vector2<T> kn::Vector2< T >::operator/ | ( | const T & | d | ) | const [inline] |
Divides the Vector2 by a value.
| d | the value dividing this Vector |
| MathException | d is null |
Reimplemented from kn::Vector< T >.
Definition at line 202 of file Vector2.hpp.
| Vector2< T > & kn::Vector2< T >::operator/= | ( | const T & | d | ) | [inline] |
Divides the Vector2 with a value All values of the Vector2 are divided by d.
| d | the value divided with this Vector2 |
Reimplemented from kn::Vector< T >.
Definition at line 363 of file Vector2.hpp.
| Vector2< T > & kn::Vector2< T >::operator= | ( | const Vector2< T > & | v | ) | [inline] |
copy the value of the argument vector2 to this vector
| v | the source vector |
Definition at line 323 of file Vector2.hpp.
| void kn::Vector2< T >::setZero | ( | void | ) | [inline] |
Reset the vector entries to zero.
Reimplemented from kn::Vector< T >.
Definition at line 272 of file Vector2.hpp.
| size_t kn::Vector2< T >::size | ( | void | ) | const [inline] |
Returns the number of rows of the Vector.
Reimplemented from kn::Vector< T >.
Definition at line 258 of file Vector2.hpp.
| const T& kn::Vector2< T >::x | ( | void | ) | const [inline] |
Return x coordinate reference.
Definition at line 122 of file Vector2.hpp.
| T& kn::Vector2< T >::x | ( | void | ) | [inline] |
Return x coordinate reference.
Definition at line 114 of file Vector2.hpp.
| const T& kn::Vector2< T >::y | ( | void | ) | const [inline] |
Return y coordinate reference.
Definition at line 138 of file Vector2.hpp.
| T& kn::Vector2< T >::y | ( | void | ) | [inline] |
Return y coordinate reference.
Definition at line 130 of file Vector2.hpp.
1.5.8