|
| | Vec2T () noexcept=default |
| | Default constructor. Leaves the components uninitialized.
|
| |
| constexpr | Vec2T (const Vec2T &u) noexcept=default |
| | Copy constructor.
|
| |
| constexpr | Vec2T (const T &a_x, const T &a_y) noexcept |
| | Full constructor.
|
| |
|
| ~Vec2T ()=default |
| | Destructor (does nothing)
|
| |
| constexpr T & | operator[] (size_t i) noexcept |
| | Mutable element access.
|
| |
| constexpr const T & | operator[] (size_t i) const noexcept |
| | Const element access.
|
| |
| constexpr Vec2T< T > & | operator= (const Vec2T &a_other) noexcept=default |
| | Assignment operator.
|
| |
| constexpr Vec2T< T > | operator+ (const Vec2T &a_other) const noexcept |
| | Addition operator.
|
| |
| constexpr Vec2T< T > | operator- (const Vec2T &a_other) const noexcept |
| | Subtraction operator.
|
| |
| constexpr Vec2T< T > | operator- () const noexcept |
| | Negation operator.
|
| |
| constexpr Vec2T< T > | operator* (const T &s) const noexcept |
| | Scalar multiplication operator.
|
| |
| constexpr Vec2T< T > | operator/ (const T &s) const noexcept |
| | Scalar division operator.
|
| |
| constexpr Vec2T< T > & | operator+= (const Vec2T &a_other) noexcept |
| | In-place addition operator.
|
| |
| constexpr Vec2T< T > & | operator-= (const Vec2T &a_other) noexcept |
| | In-place subtraction operator.
|
| |
| constexpr Vec2T< T > & | operator*= (const T &s) noexcept |
| | In-place scalar multiplication operator.
|
| |
| constexpr Vec2T< T > & | operator/= (const T &s) noexcept |
| | In-place scalar division operator.
|
| |
| constexpr T | dot (const Vec2T &a_other) const noexcept |
| | Dot product.
|
| |
| T | length () const noexcept |
| | Compute length of vector.
|
| |
| constexpr T | length2 () const noexcept |
| | Compute squared vector length.
|
| |
|
| static constexpr Vec2T< T > | zeros () noexcept |
| | Return a vector with x = y = 0.
|
| |
| static constexpr Vec2T< T > | ones () noexcept |
| | Return a vector with x = y = 1.
|
| |
| static constexpr Vec2T< T > | min () noexcept |
| | Return the most-negative representable vector.
|
| |
| static constexpr Vec2T< T > | max () noexcept |
| | Return the most-positive representable vector.
|
| |
| static constexpr Vec2T< T > | infinity () noexcept |
| | Return a vector with infinite components.
|
| |
template<typename T>
class EBGeometry::Vec2T< T >
Two-dimensional vector class with arithmetic operators.
Like Vec3T, the components are reached through operator[] (index 0 or 1).
- Note
- Vec2T is used where a computation is reduced to two dimensions: a point projected to the plane of a DCEL polygon face or a triangle, and the cross-sections of some analytic shapes.
- Template Parameters
-
| T | Floating-point precision (float or double). |
Default constructor. Leaves the components uninitialized.
Defaulted, so that Vec2T is trivially default constructible and can be the element type of a CUDA/HIP __shared__ array, which may not have an initializer. As with a plain T, Vec2T<T> v; leaves v uninitialized, while value initialization (Vec2T<T> v{};, Vec2T<T>()) zeroes it, as does zeros().