14 template <
class T> T abs(
const T &t) {
18 template <
class T> T max0(
const T &t1,
const T &t2) {
22 template <
class T> T min0(
const T &t1,
const T &t2) {
37 static constexpr uint32 vdim = 2;
42 constexpr Vector2() : a_({initVal<T>(),initVal<T>()}) { }
49 constexpr Vector2(
const T &x,
const T &y) : a_({x,y}) { }
51 explicit constexpr Vector2(
const T &t) : a_({t,t}) { }
58 constexpr const T &
x()
const {
return a_[0]; }
60 constexpr const T &
y()
const {
return a_[1]; }
62 constexpr const T &
dof(
unsigned u)
const {
return a_[u]; }
64 T &
rx() {
return a_[0]; }
66 T &
ry() {
return a_[1]; }
68 T &
rdof(
unsigned u) {
return a_[u]; }
70 constexpr const T &
operator[](
unsigned u)
const {
return dof(u); }
72 template <std::
size_t N>
constexpr decltype(
auto) get()
const {
73 static_assert(N<2,
"Index out of range");
79 constexpr T
fsum()
const {
return (std::abs(x())+std::abs(y())); }
81 constexpr T
sum()
const {
return x() + y(); }
83 constexpr T
mag2()
const {
return (x()*x()+y()*y()); }
85 constexpr T
mag()
const {
return to<T>(std::sqrt(to<double>(mag2()))); }
87 constexpr T
area()
const {
return (x()*y()); }
89 constexpr T
volume()
const {
return area(); }
91 constexpr T
spread()
const {
return (y() -x()); }
97 constexpr void fill(
const T &d) { rx()=d; ry()=d; }
99 constexpr T
maxComp()
const {
return std::max(x(),y()); }
101 constexpr T
minComp()
const {
return std::min(x(),y()); }
151 constexpr bool contains(
const T &t)
const {
if (t<x())
return false;
if (t>y())
return false;
return true; }
166 static constexpr uint32 vdim = 3;
170 constexpr Vector3() : a_({initVal<T>(),initVal<T>(),initVal<T>()}) { }
177 constexpr Vector3(
const T &x,
const T &y,
const T &z=0) : a_({x,y,z}) { }
179 explicit constexpr Vector3(
const T &t) : a_({t,t,t}) { }
184 constexpr const T &
x()
const {
return a_[0]; }
186 constexpr const T &
y()
const {
return a_[1]; }
188 constexpr const T &
z()
const {
return a_[2]; }
190 constexpr const T &
dof(
unsigned u)
const {
return a_[u]; }
192 T &
rx() {
return a_[0]; }
194 T &
ry() {
return a_[1]; }
196 T &
rz() {
return a_[2]; }
198 T &
rdof(
unsigned u) {
return a_[u]; }
200 constexpr const T &
operator[](
unsigned u)
const {
return dof(u); }
203 template <std::
size_t N>
constexpr T get()
const {
204 static_assert(N<3,
"Index out of range");
210 constexpr T
fsum()
const {
return (std::abs(x())+std::abs(y())+std::abs(z())); }
212 constexpr T
sum()
const {
return x()+y()+z(); }
214 constexpr T
mag2()
const {
return (x()*x()+y()*y()+z()*z()); }
216 constexpr T
mag()
const {
return to<T>(std::sqrt(to<double>(mag2()))); }
218 constexpr T
volume()
const {
return (x()*y()*z()); }
224 void fill(
const T &d) { rx()=d; ry()=d; rz()=d; }
226 constexpr T
maxComp()
const {
return std::max(x(),std::max(y(),z())); }
228 constexpr T
minComp()
const {
return std::min(x(),std::min(y(),z())); }
230 constexpr unsigned maxCompIndex()
const {
return x() > y() ? (x() > z() ? 0 : 2) : (y() > z() ? 1 : 2); }
232 constexpr unsigned minCompIndex()
const {
return x() < y() ? (x() < z() ? 0 : 2) : (y() < z() ? 1 : 2); }
243 constexpr bool operator<(
const Vector3<T> &v)
const {
if (x()!=v.
x())
return x()<v.
x();
if (y()!=v.
y())
return y()<v.
y();
return z()<v.
z(); }
245 constexpr bool operator>(
const Vector3<T> &v)
const {
if (x()!=v.
x())
return x()>v.
x();
if (y()!=v.
y())
return y()>v.
y();
return z()>v.
z(); }
266 Vector3<T> out((y()*v.
z())-(z()*v.
y()),(z()*v.
x())-(x()*v.
z()),(x()*v.
y())-(y()*v.
x()));
295template <
class T>
inline constexpr DVect2
toDVect2(
const Vector2<T> &v) { DVect2 dv2(to<double>(v.
x()),to<double>(v.
y()));
return dv2; }
302template <
class T>
inline constexpr I64Vect2 toI64Vect2(
const Vector2<T> &v) { I64Vect2 iv2(to<int64>(v.
x()),to<int64>(v.
y()));
return iv2; }
306template <
class T>
inline constexpr U64Vect2 toU64Vect2(
const Vector2<T> &v) { U64Vect2 uv2(to<uint64>(v.
x()),to<uint64>(v.
y()));
return uv2; }
311 DVect3 dv3(to<double>(v.
x()),to<double>(v.
y()),to<double>(v.
z()));
317 FVect3 fv3(to<float>(v.
x()),to<float>(v.
y()),to<float>(v.
z()));
323 IVect3 iv3(to<int32>(v.
x()),to<int32>(v.
y()),to<int32>(v.
z()));
326template <
class T>
inline I64Vect3 toI64Vect3(
const Vector3<T> &v) {
327 I64Vect3 iv3(to<int64>(v.
x()),to<int64>(v.
y()),to<int64>(v.
z()));
333 U64Vect3 uv3(to<uint64>(v.
x()),to<uint64>(v.
y()),to<uint64>(v.
z()));
348 Vector2<T> out(std::max<T>(v1.
x(),v2.
x()),std::max<T>(v1.
y(),v2.
y()));
354 Vector2<T> out(std::min<T>(v1.
x(),v2.
x()),std::min<T>(v1.
y(),v2.
y()));
361 Vector2<T> out(v2.
x() < 0 ? -qAbs(v1.
x()) : qAbs(v1.
x()) ,v2.
y() < 0 ? -qAbs(v1.
y()) : qAbs(v1.
y()));
368 Vector3<T> out(std::max<T>(v1.
x(),v2.
x()),std::max<T>(v1.
y(),v2.
y()),std::max<T>(v1.
z(),v2.
z()));
374 Vector3<T> out(std::min<T>(v1.
x(),v2.
x()),std::min<T>(v1.
y(),v2.
y()),std::min<T>(v1.
z(),v2.
z()));
381 Vector3<T> out(v2.
x() < 0 ? -qAbs(v1.
x()) : qAbs(v1.
x()), v2.
y() < 0 ? -qAbs(v1.
y()) : qAbs(v1.
y()), v2.
z() < 0 ? -qAbs(v1.
z()) : qAbs(v1.
z()));
416 IVect2 out(qRound(v.
x()),qRound(v.
y()));
423 IVect3 out(qRound(v.
x()),qRound(v.
y()),qRound(v.
z()));
426template <
class T> I64Vect3
constexpr v64round(
const Vector3<T> &v) {
427 I64Vect3 out(std::llround(v.
x()),std::llround(v.
y()),std::llround(v.
z()));
442 template <
class T>
struct tuple_size<
Vector2<T>> : std::integral_constant<std::size_t, 2> {};
443 template <
class T>
struct tuple_size<
Vector3<T>> : std::integral_constant<std::size_t, 3> {};
444 template <std::
size_t N,
class T>
struct tuple_element<N,
Vector2<T>> {
using type = T; };
445 template <std::
size_t N,
class T>
struct tuple_element<N,
Vector3<T>> {
using type = T; };
451 namespace basehelper {
452 template <
typename T>
453 string tsVect(
const Vector2<T> &t,
int width,
char notation,
int precision,
char fill) {
454 if (abs(width) > 5) width = width < 0 ? -abs(abs(width) - 3) : abs(abs(width) - 3);
456 int w2 = std::abs(width)/2;
457 int w1 = std::abs(width) - w2;
458 if (width<0) { w1 *= -1; w2 *= -1; }
459 return "("+ts(t.
x(), w1, notation, precision, fill)+
","
460 +ts(t.
y(), w2, notation, precision, fill)+
")";
462 template <
typename T>
463 string tsVect(
const Vector3<T> &t,
int width,
char notation,
int precision,
char fill) {
464 if (abs(width) > 7) width = width < 0 ? -abs(abs(width) - 4) : abs(abs(width) - 4);
466 int w3 = std::abs(width)/3;
467 int w2 = (std::abs(width)-w3)/2;
468 int w1 = std::abs(width) - w2 - w3;
469 if (width<0) { w1 *= -1; w2 *= -1; w3 *= -1; }
470 return "("+ts(t.
x(), w1, notation, precision, fill)+
","
471 +ts(t.
y(), w2, notation, precision, fill)+
","
472 +ts(t.
z(), w3, notation, precision, fill)+
")";
477 inline string ts(
const DVect2 &t,
int width,
char notation,
int precision,
char fill) {
478 return basehelper::tsVect(t, width, notation, precision, fill);
482 inline string ts(
const DVect3 &t,
int width,
char notation,
int precision,
char fill) {
483 return basehelper::tsVect(t, width, notation, precision, fill);
487 inline string ts(
const IVect2 &t,
int width,
char notation,
int precision,
char fill) {
488 return basehelper::tsVect(t, width, notation, precision, fill);
492 inline string ts(
const IVect3 &t,
int width,
char notation,
int precision,
char fill) {
493 return basehelper::tsVect(t, width, notation, precision, fill);
497 inline string ts(
const I64Vect2 &t,
int width,
char notation,
int precision,
char fill) {
498 return basehelper::tsVect(t, width, notation, precision, fill);
502 inline string ts(
const I64Vect3 &t,
int width,
char notation,
int precision,
char fill) {
503 return basehelper::tsVect(t, width, notation, precision, fill);
511struct fmt::formatter<
Vector2<T>> :
public fmt::formatter<double> {
512 template <
typename ParseContext>
513 constexpr auto parse(ParseContext &ctx) {
return fmt::formatter<double>::parse(ctx); }
516 template <
typename FormatContext>
517 auto format(
Vector2<T> const &val, FormatContext &ctx) {
518 format_to(ctx.out(),
"(");
519 fmt::formatter<double>::format(val.
x(),ctx);
520 format_to(ctx.out(),
",");
521 fmt::formatter<double>::format(val.
y(),ctx);
522 return format_to(ctx.out(),
")");
530struct fmt::formatter<
Vector3<T>> :
public fmt::formatter<double> {
531 template <
typename ParseContext>
532 constexpr auto parse(ParseContext &ctx) {
return fmt::formatter<double>::parse(ctx); }
535 template <
typename FormatContext>
536 auto format(
Vector3<T> const &val, FormatContext &ctx) {
537 format_to(ctx.out(),
"(");
538 fmt::formatter<double>::format(val.
x(),ctx);
539 format_to(ctx.out(),
",");
540 fmt::formatter<double>::format(val.
y(),ctx);
541 format_to(ctx.out(),
",");
542 fmt::formatter<double>::format(val.
z(),ctx);
543 return format_to(ctx.out(),
")");
QString helper functions, plus some additions.
2D vector utility class.
Definition vect.h:34
constexpr Vector2< T > operator*(const Vector2< T > &v) const
Binary mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done...
Definition vect.h:133
constexpr T minComp() const
Returns the minimum component.
Definition vect.h:101
constexpr bool operator>(const Vector2< T > &v) const
Comparison operator, based on magnitude.
Definition vect.h:118
constexpr const Vector2< T > & operator/=(const Vector2< T > &v)
In place mathematical operators using vectors and scalars – Note that * and / of Vector2 types are do...
Definition vect.h:126
constexpr Vector2< T > unit() const
Unit vector - be sure vector is nonzero.
Definition vect.h:93
constexpr void fill(const T &d)
Fills all three components with value d.
Definition vect.h:97
constexpr T mag2() const
Square of the magnitude, or the dot product with itself.
Definition vect.h:83
constexpr Vector2(const Vector2< T > &v)
Copy constructor.
Definition vect.h:47
constexpr Vector2< T > expandedToInclude(const T &t) const
Returns 1D range expanded to include value t;.
Definition vect.h:147
T & operator[](unsigned u)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition vect.h:71
constexpr const Vector2< T > & expandToInclude(const Vector2< T > &v)
Expands 1D range to include 1D range v.
Definition vect.h:145
constexpr const Vector2< T > & operator/=(const T &t)
In place mathematical operators using vectors and scalars – Note that * and / of Vector2 types are do...
Definition vect.h:127
constexpr const Vector2< T > & expandToInclude(const T &t)
Expands 1D range to include value t.
Definition vect.h:143
constexpr unsigned maxCompIndex() const
Returns the max component index.
Definition vect.h:103
constexpr const Vector2< T > & operator+=(const Vector2< T > &v)
In place mathematical operators using vectors and scalars – Note that * and / of Vector2 types are do...
Definition vect.h:122
constexpr T spread() const
Assumes vector is being used to store a 1D extent– Returns max-min. (y-x).
Definition vect.h:91
constexpr const Vector2< T > & operator-=(const Vector2< T > &v)
In place mathematical operators using vectors and scalars – Note that * and / of Vector2 types are do...
Definition vect.h:123
constexpr const Vector2< T > safeDiv(const Vector2< T > &v)
"Safe" division operation - checks for zero and overflow.
Definition vect.h:109
constexpr bool operator==(const Vector2< T > &v) const
Comparison operator - no tolerance is used.
Definition vect.h:112
constexpr T operator|(const Vector2< T > &v) const
Dot Product.
Definition vect.h:139
constexpr const Vector2< T > & operator*=(const Vector2< T > &v)
In place mathematical operators using vectors and scalars – Note that * and / of Vector2 types are do...
Definition vect.h:124
constexpr const T & operator[](unsigned u) const
Allow array like access by degree of freedom (0-1)
Definition vect.h:70
constexpr Vector2< T > operator-(const Vector2< T > &v) const
Binary mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done...
Definition vect.h:132
constexpr const T & x() const
X component access.
Definition vect.h:58
constexpr T volume() const
Volume of the rectangle assuming unit depth – same as area(), provided for 2D/3D compile compatibilit...
Definition vect.h:89
constexpr Vector2< T > expandedToInclude(const Vector2< T > &v) const
Returns 1D range expanded to include 1D range v.
Definition vect.h:149
constexpr T mag() const
The magnitude.
Definition vect.h:85
constexpr const T & dof(unsigned u) const
Access to degree of freedom u (0-1).
Definition vect.h:62
T & rdof(unsigned u)
Reference accesss to degree-of-freedom u (0-1).
Definition vect.h:68
constexpr T maxComp() const
Returns the maximum component.
Definition vect.h:99
constexpr bool operator<(const Vector2< T > &v) const
Comparison operator, based on magnitude.
Definition vect.h:116
constexpr bool contains(const T &t) const
True if value t falls inside this 1D range (inclusive).
Definition vect.h:151
constexpr T fsum() const
Manhattan norm.
Definition vect.h:79
constexpr const Vector2< T > & operator*=(const T &t)
In place mathematical operators using vectors and scalars – Note that * and / of Vector2 types are do...
Definition vect.h:125
constexpr Vector2< T > abs() const
Returns vector of absolute values of components.
Definition vect.h:95
constexpr Vector2< T > operator/(const T &t) const
Binary mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done...
Definition vect.h:136
constexpr Vector2< T > operator*(const T &t) const
Binary mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done...
Definition vect.h:134
static Vector2< T > nothing()
Creates an "empty" vector, useful when Vector2 is used as a 1D extent.
Definition vect.h:54
constexpr const Vector2< T > & safeDivE(const Vector2< T > &v)
"Safe" division operation - checks for zero and overflow.
Definition vect.h:107
constexpr bool operator!=(const Vector2< T > &v) const
Comparison operator - no tolerance is used.
Definition vect.h:114
constexpr Vector2< T > operator/(const Vector2< T > &v) const
Binary mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done...
Definition vect.h:135
constexpr T area() const
Size of rectangle represented by x*y - can be negative.
Definition vect.h:87
constexpr unsigned minCompIndex() const
Returns the min component index.
Definition vect.h:105
T & rx()
Reference access to x-component.
Definition vect.h:64
constexpr T sum() const
Sum of components.
Definition vect.h:81
Vector2()
Default constructor, no data initialization.
Definition vect.h:44
constexpr Vector2(const T &t)
Explicit contructor, each component is given value t.
Definition vect.h:51
constexpr const T & y() const
Y component access.
Definition vect.h:60
constexpr Vector2< T > operator+(const Vector2< T > &v) const
Binary mathematical operators using vectors and scalars – Note that * and / of Vector2 types are done...
Definition vect.h:131
constexpr Vector2(const T &x, const T &y)
Explicit constructor, from two components.
Definition vect.h:49
T & ry()
Reference access to y-component.
Definition vect.h:66
3D vector utility class.
Definition vect.h:163
constexpr const Vector3< T > safeDiv(const Vector3< T > &v)
"Safe" division operation - checks for zero and overflow.
Definition vect.h:236
constexpr bool operator<(const Vector3< T > &v) const
Comparison operator, compare each DOF in order.
Definition vect.h:243
constexpr const T & y() const
The y-component of the vector.
Definition vect.h:186
T & rx()
Reference access to the x-component of the vector.
Definition vect.h:192
constexpr T maxComp() const
Returns the maximum component.
Definition vect.h:226
constexpr Vector3< T > operator&(const Vector3< T > &v) const
Cross Product.
Definition vect.h:265
constexpr const Vector3< T > & safeDivE(const Vector3< T > &v)
"Safe" division operation - checks for zero and overflow.
Definition vect.h:234
constexpr T operator|(const Vector3< T > &v) const
Dot Product.
Definition vect.h:270
T & ry()
Reference access to the y-component of the vector.
Definition vect.h:194
constexpr const Vector3< T > & operator-=(const Vector3< T > &v)
In-place mathematical operators – * and / are done on a component basis.
Definition vect.h:250
constexpr const Vector3< T > & operator+=(const Vector3< T > &v)
In-place mathematical operators – * and / are done on a component basis.
Definition vect.h:249
constexpr unsigned minCompIndex() const
Returns the min component index.
Definition vect.h:232
constexpr Vector3< T > operator+(const Vector3< T > &v) const
Binary mathematical operators – * and / are done on a component basis.
Definition vect.h:258
constexpr bool operator>(const Vector3< T > &v) const
Comparison operator, compare each DOF in order.
Definition vect.h:245
constexpr const Vector3< T > & operator*=(const Vector3< T > &v)
In-place mathematical operators – * and / are done on a component basis.
Definition vect.h:251
constexpr T fsum() const
Manhattan norm.
Definition vect.h:210
constexpr Vector3< T > operator/(const T &t) const
Binary mathematical operators – * and / are done on a component basis.
Definition vect.h:263
constexpr Vector3(const Vector3< T > &v)
Copy constructor.
Definition vect.h:175
Vector3()
Default constructor - no data initialization.
Definition vect.h:172
constexpr T minComp() const
Returns the minimum component.
Definition vect.h:228
constexpr const Vector3< T > & operator/=(const Vector3< T > &v)
In-place mathematical operators – * and / are done on a component basis.
Definition vect.h:253
constexpr const Vector3< T > & operator/=(const T &t)
In-place mathematical operators – * and / are done on a component basis.
Definition vect.h:254
constexpr Vector3< T > operator*(const Vector3< T > &v) const
Binary mathematical operators – * and / are done on a component basis.
Definition vect.h:260
constexpr const T & x() const
The x-component of the vector.
Definition vect.h:184
constexpr T mag2() const
Square of the magnitude, or the vector dotted with itself.
Definition vect.h:214
constexpr bool operator!=(const Vector3< T > &v) const
Comparison operator - no tolerance is used.
Definition vect.h:241
constexpr Vector3< T > operator/(const Vector3< T > &v) const
Binary mathematical operators – * and / are done on a component basis.
Definition vect.h:262
constexpr const Vector3< T > & operator*=(const T &t)
In-place mathematical operators – * and / are done on a component basis.
Definition vect.h:252
T & rdof(unsigned u)
Reference access to degree-of-freedom u (0-2) of the vector.
Definition vect.h:198
constexpr Vector3(const T &t)
Explicit constructor, all three components are inintialized to t.
Definition vect.h:179
constexpr bool operator==(const Vector3< T > &v) const
Comparison operator - no tolerance is used.
Definition vect.h:239
constexpr T volume() const
Volume of region represented by x*y*z - can be negative.
Definition vect.h:218
void fill(const T &d)
Fills all three components with value d.
Definition vect.h:224
Vector3< T > unit() const
Unit vector - be sure vector is nonzero.
Definition vect.h:220
constexpr unsigned maxCompIndex() const
Returns the max component index.
Definition vect.h:230
constexpr Vector3< T > abs() const
Returns vector of absolute values of components.
Definition vect.h:222
constexpr const T & z() const
The z-component of the vector.
Definition vect.h:188
constexpr Vector3< T > operator*(const T &t) const
Binary mathematical operators – * and / are done on a component basis.
Definition vect.h:261
constexpr T mag() const
The vector magnitude.
Definition vect.h:216
T & rz()
Reference access to the z-component of the vector.
Definition vect.h:196
T & operator[](unsigned u)
Allows array like access to degrees-of-freedom.
Definition vect.h:202
constexpr const T & operator[](unsigned u) const
Allows array like access to degrees-of-freedom.
Definition vect.h:200
constexpr Vector3(const T &x, const T &y, const T &z=0)
Explicit constructor, by the three components of the vector.
Definition vect.h:177
constexpr T sum() const
Sum of components.
Definition vect.h:212
constexpr const T & dof(unsigned u) const
The degree-of-freedom u (0-2) component.
Definition vect.h:190
constexpr Vector3< T > operator-(const Vector3< T > &v) const
Binary mathematical operators – * and / are done on a component basis.
Definition vect.h:259
debug checked shorthand for std::numeric_limits<T>::
Definition limit.h:25
Vector3< T > vceil(const Vector3< T > &v)
Definition vect.h:394
constexpr Vector3< T > toVect3(const Vector2< T > &v, const T &t=0)
Conversion between vectors of different dimension.
Definition vect.h:341
constexpr U64Vect3 toU64Vect3(const Vector3< T > &v)
Definition vect.h:332
IVect2 vround(const Vector2< T > &v)
Definition vect.h:415
constexpr Vector2< T > vmax(const Vector2< T > &v1, const Vector2< T > &v2)
Definition vect.h:347
constexpr FVect3 toFVect3(const Vector3< T > &v)
Definition vect.h:316
constexpr Vector3< T > vmax(const Vector3< T > &v1, const Vector3< T > &v2)
Definition vect.h:367
IVect3 constexpr vround(const Vector3< T > &v)
Definition vect.h:422
Vector2< T > vfloor(const Vector2< T > &v)
Definition vect.h:401
constexpr IVect2 toIVect2(const Vector2< T > &v)
Definition vect.h:301
Vector3< T > vfloor(const Vector3< T > &v)
Definition vect.h:408
constexpr const Vector2< T > & toVect2(const Vector2< T > &v)
Conversion between vectors of different dimension.
Definition vect.h:339
Vector2< T > vceil(const Vector2< T > &v)
Definition vect.h:387
constexpr Vector3< T > vmin(const Vector3< T > &v1, const Vector3< T > &v2)
Definition vect.h:373
constexpr DVect3 toDVect3(const Vector3< T > &v)
Definition vect.h:310
constexpr IVect3 toIVect3(const Vector3< T > &v)
Definition vect.h:322
constexpr const T safeDiv(const T num, const T denom)
This function provids "safe" division operation, checks explicitly for zero.
Definition to.h:117
constexpr UVect2 toUVect2(const Vector2< T > &v)
Definition vect.h:305
constexpr Vector3< T > vsign(const Vector3< T > &v1, const Vector3< T > &v2)
Definition vect.h:380
constexpr DVect2 toDVect2(const Vector2< T > &v)
Definition vect.h:295
constexpr Vector2< T > vsign(const Vector2< T > &v1, const Vector2< T > &v2)
Definition vect.h:360
constexpr FVect2 toFVect2(const Vector2< T > &v)
Definition vect.h:298
constexpr Vector2< T > vmin(const Vector2< T > &v1, const Vector2< T > &v2)
Definition vect.h:353
A overflow checked shorthand for static_cast<T>().
constexpr Vector2< T > max(const Vector2< T > &v1, const Vector2< T > &v2)
Template specialization for max, min.
Definition vect.h:433
constexpr Vector2< T > min(const Vector2< T > &v1, const Vector2< T > &v2)
Template specialization for max, min.
Definition vect.h:435