#include <MRVector2.h>
Public Types | |
using | ValueType = T |
using | MatrixType = Matrix2<T> |
using | SymMatrixType = SymMatrix2<T> |
Public Member Functions | |
constexpr | Vector2 () noexcept |
Vector2 (NoInit) noexcept | |
constexpr | Vector2 (T x, T y) noexcept |
constexpr | Vector2 (const Vector3< T > &v) noexcept |
template<typename U > | |
constexpr | Vector2 (const Vector2< U > &v) noexcept |
constexpr const T & | operator[] (int e) const noexcept |
constexpr T & | operator[] (int e) noexcept |
T | lengthSq () const |
auto | length () const |
Vector2 | normalized () const |
Vector2 | operator- () const |
const Vector2 & | operator+ () const |
Vector2 | furthestBasisVector () const |
returns one of 2 basis unit vector that makes the biggest angle with the direction specified by this | |
Vector2 | perpendicular () const |
returns same length vector orthogonal to this (rotated 90 degrees counter-clockwise) | |
Vector2 & | operator+= (const Vector2< T > &b) |
Vector2 & | operator-= (const Vector2< T > &b) |
Vector2 & | operator*= (T b) |
Vector2 & | operator/= (T b) |
bool | isFinite () const |
Static Public Member Functions | |
static constexpr Vector2 | diagonal (T a) noexcept |
static constexpr Vector2 | plusX () noexcept |
static constexpr Vector2 | plusY () noexcept |
static constexpr Vector2 | minusX () noexcept |
static constexpr Vector2 | minusY () noexcept |
Public Attributes | |
T | x |
T | y |
Static Public Attributes | |
static constexpr int | elements = 2 |
Related Symbols | |
(Note that these are not member symbols.) | |
template<typename T > | |
T | distanceSq (const Vector2< T > &a, const Vector2< T > &b) |
squared distance between two points, which is faster to compute than just distance | |
template<typename T > | |
T | distance (const Vector2< T > &a, const Vector2< T > &b) |
distance between two points, better use distanceSq for higher performance | |
template<typename T > | |
T | cross (const Vector2< T > &a, const Vector2< T > &b) |
cross product | |
template<typename T > | |
T | dot (const Vector2< T > &a, const Vector2< T > &b) |
dot product | |
template<typename T > | |
T | sqr (const Vector2< T > &a) |
squared length | |
template<typename T > | |
Vector2< T > | mult (const Vector2< T > &a, const Vector2< T > &b) |
per component multiplication | |
template<typename T > | |
Vector2< T > | div (const Vector2< T > &a, const Vector2< T > &b) |
per component division | |
template<typename T > | |
T | angle (const Vector2< T > &a, const Vector2< T > &b) |
angle in radians between two vectors | |
two-dimensional vector
using MR::Vector2< T >::MatrixType = Matrix2<T> |
using MR::Vector2< T >::SymMatrixType = SymMatrix2<T> |
using MR::Vector2< T >::ValueType = T |
|
inlineconstexprnoexcept |
|
inlineexplicitnoexcept |
|
inlineconstexprnoexcept |
|
inlineexplicitconstexprnoexcept |
|
inlineexplicitconstexprnoexcept |
|
inlinestaticconstexprnoexcept |
Vector2 MR::Vector2< T >::furthestBasisVector | ( | ) | const |
returns one of 2 basis unit vector that makes the biggest angle with the direction specified by this
|
inlinenodiscard |
|
inline |
|
inline |
|
inlinestaticconstexprnoexcept |
|
inlinestaticconstexprnoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inline |
returns same length vector orthogonal to this (rotated 90 degrees counter-clockwise)
|
inlinestaticconstexprnoexcept |
|
inlinestaticconstexprnoexcept |
angle in radians between two vectors
cross product
distance between two points, better use distanceSq for higher performance
squared distance between two points, which is faster to compute than just distance
per component division
per component multiplication
|
related |
squared length
|
staticconstexpr |
T MR::Vector2< T >::x |
T MR::Vector2< T >::y |