Generic template for 2D and 3D vectors.
More...
#include <plask/vector/common.hpp>
|
(Note that these are not member symbols.)
|
template<int dim, typename T > |
double | abs2 (const Vec< dim, T > &v) |
| Calculate square of vector magnitude.
|
|
template<int dim, typename T , typename OtherT > |
constexpr auto | operator* (const OtherT &scale, const Vec< dim, T > &v) -> decltype(v *scale) |
| Multiply vector v by scalar scale .
|
|
template<int dim, typename T > |
#define | abs(x) ((x) >= 0 ? (x) : -(x)) |
| Calculate vector magnitude.
|
|
template<int dim, typename T > |
bool | isnan (const Vec< dim, T > &v) |
| Check if any vector componen is not-a-number.
|
|
template<int dst_dim, typename T , int src_dim> |
Vec< dst_dim, T > | vec (const Vec< src_dim, T > &src) |
| Convert vector between space.
|
|
template<typename T > |
Vec< 3, T > | vec (const Vec< 2, T > &src, T lon) |
| Convert vector 2D to 3D space.
|
|
Vec< 2, double > | rotateToLonTranAbs (const Vec< 3, double > &v) |
| Rotate v over up axis to lie on tran-vert plane.
|
|
Vec< 2, double > | rotateToLonTranSgn (const Vec< 3, double > &v) |
| Rotate v over up axis to lie on tran-vert plane.
|
|
template<typename T > |
Vec< 3, T > | vec3Dplus2D (const Vec< 3, T > &v3, const Vec< 2, T > &v2, T lon) |
| Calculate v3 + v2 with given lon coordinate.
|
|
template<typename T > |
Vec< 3, T > | vec3Dplus2D (const Vec< 3, T > &v3, const Vec< 2, T > &v2) |
| Calculate v3 + v2 , same as vec3Dplus2D(v3, v2, 0.0).
|
|
template<
int dim,
typename T = double>
struct plask::Vec< dim, T >
Generic template for 2D and 3D vectors.
Definition at line 26 of file common.hpp.
◆ abs
Calculate vector magnitude.
- Parameters
-
- Returns
- vector magnitude
Definition at line 58 of file vec.hpp.
◆ abs2()
Calculate square of vector magnitude.
- Parameters
-
- Returns
- square of vector magnitude
Definition at line 28 of file vec.hpp.
◆ isnan()
Check if any vector componen is not-a-number.
- Parameters
-
- Returns
true
if any vector magnitude is Nan
Definition at line 69 of file vec.hpp.
◆ operator*()
Multiply vector v
by scalar scale
.
- Parameters
-
- Returns
- vector
v
multiplied by scalar
Definition at line 47 of file vec.hpp.
◆ rotateToLonTranAbs()
Rotate v
over up axis to lie on tran-vert plane.
- Parameters
-
- Returns
- vector in 2D space, after rotation, with tran()>=0 and vert()==v.vert()
Definition at line 120 of file vec.hpp.
◆ rotateToLonTranSgn()
Rotate v
over up axis to lie on tran-vert plane.
- Parameters
-
- Returns
- vector in 2D space, after rotation, with sign of tran() same as v.tran() and vert()==v.vert()
Definition at line 129 of file vec.hpp.
◆ vec() [1/2]
Convert vector 2D to 3D space.
- Parameters
-
src | source vector |
lon | longitude coordinate |
- Returns
src
vector in destination space and given lon
coordinate
Definition at line 111 of file vec.hpp.
◆ vec() [2/2]
Convert vector between space.
- Parameters
-
- Returns
src
vector in destination space
Definition at line 100 of file vec.hpp.
◆ vec3Dplus2D() [1/2]
Calculate v3
+ v2
, same as vec3Dplus2D(v3, v2, 0.0).
- Parameters
-
v3 | vector in 3D space |
v2 | vector in 2D space |
- Returns
v3
+ v2
Definition at line 154 of file vec.hpp.
◆ vec3Dplus2D() [2/2]
Calculate v3
+ v2
with given lon
coordinate.
- Parameters
-
v3 | vector in 3D space |
v2 | vector in 2D space |
lon | last coordinate of v2 |
- Returns
v3
+ v2
with given lon
coordinate
Definition at line 142 of file vec.hpp.
The documentation for this struct was generated from the following files: