A generic 2D vector type. More...
#include <vec_2d.hpp>
Public Types | |
using | value_type = T |
Public Attributes | |
value_type | x |
value_type | y |
Friends | |
std::ostream & | operator<< (std::ostream &os, cuspatial::vec_2d< T > const &vec) |
Output stream operator for vec_2d<T> for human-readable formatting. | |
bool CUSPATIAL_HOST_DEVICE | operator== (vec_2d< T > const &lhs, vec_2d< T > const &rhs) |
Compare two 2D vectors for equality. | |
vec_2d< T > CUSPATIAL_HOST_DEVICE | operator+ (vec_2d< T > const &a, vec_2d< T > const &b) |
Element-wise addition of two 2D vectors. | |
vec_2d< T > CUSPATIAL_HOST_DEVICE | operator- (vec_2d< T > const &a, vec_2d< T > const &b) |
Element-wise subtraction of two 2D vectors. | |
vec_2d< T > CUSPATIAL_HOST_DEVICE | operator- (vec_2d< T > const &a) |
Invert a 2D vector. | |
vec_2d< T > CUSPATIAL_HOST_DEVICE | operator* (vec_2d< T > vec, T const &r) |
Scale a 2D vector by a factor r . | |
vec_2d< T > CUSPATIAL_HOST_DEVICE | operator* (T const &r, vec_2d< T > vec) |
Scale a 2d vector by ratio r . | |
vec_2d< T > &CUSPATIAL_HOST_DEVICE | operator+= (vec_2d< T > &a, vec_2d< T > const &b) |
Translate a 2D point. | |
vec_2d< T > &CUSPATIAL_HOST_DEVICE | operator-= (vec_2d< T > &a, vec_2d< T > const &b) |
Translate a 2D point. | |
bool CUSPATIAL_HOST_DEVICE | operator< (vec_2d< T > const &lhs, vec_2d< T > const &rhs) |
Less than operator for two 2D points. | |
bool CUSPATIAL_HOST_DEVICE | operator> (vec_2d< T > const &lhs, vec_2d< T > const &rhs) |
Greater than operator for two 2D points. | |
bool CUSPATIAL_HOST_DEVICE | operator<= (vec_2d< T > const &lhs, vec_2d< T > const &rhs) |
Less than or equal to operator for two 2D points. | |
bool CUSPATIAL_HOST_DEVICE | operator>= (vec_2d< T > const &lhs, vec_2d< T > const &rhs) |
Greater than or equal to operator for two 2D points. | |
A generic 2D vector type.
This is the base type used in cuspatial for both Longitude/Latitude (LonLat) coordinate pairs and Cartesian (X/Y) coordinate pairs. For LonLat pairs, the x
member represents Longitude, and y
represents Latitude.
T | the base type for the coordinates |
Definition at line 42 of file vec_2d.hpp.
using cuspatial::vec_2d< T >::value_type = T |
Definition at line 44 of file vec_2d.hpp.
|
friend |
Scale a 2d vector by ratio r
.
Definition at line 100 of file vec_2d.hpp.
|
friend |
Scale a 2D vector by a factor r
.
Definition at line 92 of file vec_2d.hpp.
|
friend |
Element-wise addition of two 2D vectors.
Definition at line 68 of file vec_2d.hpp.
|
friend |
Translate a 2D point.
Definition at line 105 of file vec_2d.hpp.
Invert a 2D vector.
Definition at line 84 of file vec_2d.hpp.
|
friend |
Element-wise subtraction of two 2D vectors.
Definition at line 76 of file vec_2d.hpp.
|
friend |
Translate a 2D point.
Definition at line 115 of file vec_2d.hpp.
|
friend |
Less than operator for two 2D points.
Orders two points first by x, then by y.
Definition at line 125 of file vec_2d.hpp.
|
friend |
Output stream operator for vec_2d<T>
for human-readable formatting.
Definition at line 52 of file vec_2d.hpp.
|
friend |
Less than or equal to operator for two 2D points.
Definition at line 145 of file vec_2d.hpp.
|
friend |
Compare two 2D vectors for equality.
Definition at line 60 of file vec_2d.hpp.
|
friend |
Greater than operator for two 2D points.
Definition at line 137 of file vec_2d.hpp.
|
friend |
Greater than or equal to operator for two 2D points.
Definition at line 153 of file vec_2d.hpp.
value_type cuspatial::vec_2d< T >::x |
Definition at line 45 of file vec_2d.hpp.
value_type cuspatial::vec_2d< T >::y |
Definition at line 46 of file vec_2d.hpp.