|
Fishnet 2.0.1
Framework for Graph-Based Analysis of GIS Vector Data
|
Implementation of a two-dimensional vector. More...
#include <Vec2D.hpp>

Public Types | |
| using | numeric_type = T |
Public Member Functions | |
| constexpr | Vec2D (T x, T y) |
| template<fishnet::math::Number U, fishnet::math::Number R, typename = std::enable_if_t<(!std::is_same_v<U,T> || ! std::is_same_v<R,T>)&& std::is_same_v<T,fishnet::math::DEFAULT_NUMERIC>>> | |
| constexpr | Vec2D (U x, R y) |
| Constructor for heterogenous types Converts to the default numeric type. | |
| constexpr | Vec2D () |
| Default construction to (0,0) | |
| template<fishnet::math::Number U> | |
| constexpr | operator Vec2D< U > () const noexcept |
| Cast operator from Vec2D<T> to Vec2D | |
| constexpr T | getX () const noexcept |
| constexpr T | getY () const noexcept |
| constexpr Vec2D< T > | operator- () const |
| Negation operator e.g.: -Vec(2,1) => Vec(-2,-1) | |
| constexpr auto | operator+ (const IPoint auto &other) const noexcept |
| constexpr auto | operator- (const IPoint auto &other) const noexcept |
| template<fishnet::math::Number U> | |
| constexpr auto | operator* (U scalar) const noexcept |
| constexpr auto | operator/ (fishnet::math::DEFAULT_NUMERIC scalar) const noexcept |
| template<fishnet::math::Number U> | |
| constexpr bool | operator== (const Vec2D< U > &other) const noexcept |
| constexpr auto | dot (const IPoint auto &other) const noexcept |
| constexpr auto | cross (const IPoint auto &other) const noexcept |
| constexpr bool | isParallel (const IPoint auto &other) const noexcept |
| constexpr bool | isOrthogonal (const IPoint auto &other) const noexcept |
| constexpr fishnet::math::DEFAULT_FLOATING_POINT | length () const |
| constexpr fishnet::math::DEFAULT_FLOATING_POINT | distance (const IPoint auto &other) const |
| constexpr Vec2D< T > | orthogonal () const noexcept |
| constexpr Vec2D< fishnet::math::DEFAULT_NUMERIC > | normalize () const |
| fishnet::math::Radians | angle (const IPoint auto &reference) const |
| fishnet::math::Radians | angle (const IPoint auto &reference, fishnet::math::Radians angleRotate) const |
| constexpr size_t | hash () const noexcept |
| constexpr std::string | toString () const noexcept |
Static Public Member Functions | |
| template<fishnet::math::Number U, fishnet::math::Number V> | |
| static constexpr auto | construct (U x, V y) noexcept |
| Helper factory method to construct the correct type of vector depending on the numeric types. | |
Public Attributes | |
| T | x |
| T | y |
Static Public Attributes | |
| static constexpr GeometryType | type = GeometryType::POINT |
Implementation of a two-dimensional vector.
| T | numeric type used for computations |
| using fishnet::geometry::Vec2D< T >::numeric_type = T |
|
inlineconstexpr |
|
inlineconstexpr |
Constructor for heterogenous types Converts to the default numeric type.
| U | numeric type of x |
| R | numeric type of y |
| typename | _ enable if -> only allow if T is the default numeric type and if either U or R is not the same type as T to prevent ambiguities |
| std::is_same_v<T,fishnet::math::DEFAULT_NUMERIC>> |
|
inlineconstexpr |
Default construction to (0,0)
|
inline |
Computes the angle (counterclockwise) for the direction vector with reference at reference point, starting rotation on x-axis
| reference | for the angle |
|
inline |
Calculates the angle with the previous method (starting from x-axis and performing a counterclockwise rotation) then rotates the angle by angleRotate
| reference | |
| angleRotate |
|
inlinestaticconstexprnoexcept |
Helper factory method to construct the correct type of vector depending on the numeric types.
| U | numeric type for x |
| V | numeric type for y |
| x | |
| y |
|
inlineconstexprnoexcept |
|
inlineconstexpr |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexpr |
Negation operator e.g.: -Vec(2,1) => Vec(-2,-1)
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
staticconstexpr |
| T fishnet::geometry::Vec2D< T >::x |
| T fishnet::geometry::Vec2D< T >::y |