jaulib v1.4.0-2-g788cf73
Jau Support Library (C++, Java, ..)
Loading...
Searching...
No Matches
vec2f.hpp
Go to the documentation of this file.
1/*
2 * Author: Sven Gothel <sgothel@jausoft.com>
3 * Copyright Gothel Software e.K.
4 *
5 * SPDX-License-Identifier: MIT
6 *
7 * This Source Code Form is subject to the terms of the MIT License
8 * If a copy of the MIT was not distributed with this file,
9 * you can obtain one at https://opensource.org/license/mit/.
10 */
11
12#ifndef JAU_MATH_VEC2F_HPP_
13#define JAU_MATH_VEC2F_HPP_
14
15#include <cmath>
16#include <cstdarg>
17#include <cassert>
18#include <limits>
19#include <string>
20#include <algorithm>
21#include <iostream>
22
23#include <jau/float_math.hpp>
24#include <jau/type_concepts.hpp>
25
26namespace jau::math {
27
28 /** \addtogroup Math
29 *
30 * @{
31 */
32
33 /**
34 * 2D vector using two value_type components.
35 *
36 * Component and overall alignment is natural as sizeof(value_type),
37 * i.e. sizeof(value_type) == alignof(value_type)
38 */
39 template <jau::req::packed_floating_point Value_type>
40 class alignas(sizeof(Value_type)) Vector2F {
41 public:
44 typedef const value_type* const_pointer;
48 typedef const value_type* const_iterator;
49
50 /** value alignment is sizeof(value_type) */
51 constexpr static int value_alignment = sizeof(value_type);
52
53 /** Number of value_type components */
54 constexpr static const size_t components = 2;
55
56 /** Size in bytes with value_alignment */
57 constexpr static const size_t byte_size = components * sizeof(value_type);
58
59 constexpr static const value_type zero = value_type(0);
60 constexpr static const value_type one = value_type(1);
61
64
65 static constexpr_cxx26 Vector2F from_length_angle(const value_type magnitude, const value_type radians) noexcept {
66 return Vector2F(magnitude * std::cos(radians), magnitude * std::sin(radians));
67 }
68
69 constexpr Vector2F() noexcept
70 : x(zero), y(zero) {}
71
72 constexpr Vector2F(const value_type v) noexcept
73 : x(v), y(v) {}
74
75 constexpr Vector2F(const value_type x_, const value_type y_) noexcept
76 : x(x_), y(y_) {}
77
78 constexpr Vector2F(const Vector2F& o) noexcept = default;
79 constexpr Vector2F(Vector2F&& o) noexcept = default;
80 constexpr Vector2F& operator=(const Vector2F&) noexcept = default;
81 constexpr Vector2F& operator=(Vector2F&&) noexcept = default;
82
83 constexpr Vector2F copy() noexcept { return Vector2F(*this); }
84
85 /** Returns read-only component */
86 constexpr value_type operator[](size_t i) const noexcept {
87 assert(i < 2);
88 return (&x)[i];
89 }
90
91 explicit operator const_pointer() const noexcept { return &x; }
92 constexpr const_iterator cbegin() const noexcept { return &x; }
93
94 /** Returns writeable reference to component */
95 constexpr reference operator[](size_t i) noexcept {
96 assert(i < 2);
97 return (&x)[i];
98 }
99
100 explicit operator pointer() noexcept { return &x; }
101 constexpr iterator begin() noexcept { return &x; }
102
103 /** xy = this, returns xy. */
104 constexpr iterator get(iterator xy) const noexcept {
105 xy[0] = x;
106 xy[1] = y;
107 return xy;
108 }
109
110 constexpr bool operator==(const Vector2F& rhs ) const noexcept {
111 if( this == &rhs ) {
112 return true;
113 }
114 return jau::is_zero(x - rhs.x) && jau::is_zero(y - rhs.y);
115 }
116 /** TODO
117 constexpr std::strong_ordering operator<=>(const vec2f_t& rhs) const noexcept {
118 return ...
119 } */
120
121 constexpr Vector2F& set(const value_type vx, const value_type vy) noexcept
122 { x=vx; y=vy; return *this; }
123
124 /** this = xy, returns this. */
125 constexpr Vector2F& set(const_iterator xy) noexcept
126 { x=xy[0]; y=xy[1]; return *this; }
127
128 /** this = this + {d.x, d.y}, component wise. Returns this. */
129 constexpr Vector2F& add(const Vector2F& d) noexcept
130 { x+=d.x; y+=d.y; return *this; }
131
132 /** this = this + {dx, dy}, component wise. Returns this. */
133 constexpr Vector2F& add(const value_type dx, const value_type dy) noexcept
134 { x+=dx; y+=dy; return *this; }
135
136 /** this = this * {s.x, s.y}, component wise. Returns this. */
137 constexpr Vector2F& mul(const Vector2F& s) noexcept
138 { x*=s.x; y*=s.y; return *this; }
139
140 /** this = this * {sx, sy}, component wise. Returns this. */
141 constexpr Vector2F& mul(const value_type sx, const value_type sy) noexcept
142 { x*=sx; y*=sy; return *this; }
143
144 /** this = this * s, component wise. Returns this. */
145 constexpr Vector2F& scale(const value_type s) noexcept
146 { x*=s; y*=s; return *this; }
147
148 /** this = this + rhs, component wise. Returns this. */
149 constexpr Vector2F& operator+=(const Vector2F& rhs ) noexcept {
150 x+=rhs.x; y+=rhs.y;
151 return *this;
152 }
153
154 /** this = this - rhs, component wise. Returns this. */
155 constexpr Vector2F& operator-=(const Vector2F& rhs ) noexcept {
156 x-=rhs.x; y-=rhs.y;
157 return *this;
158 }
159
160 /**
161 * this = this * {s.x, s.y}, component wise.
162 * @param s scale factor
163 * @return this instance
164 */
165 constexpr Vector2F& operator*=(const Vector2F& s) noexcept {
166 x*=s.x; y*=s.y;
167 return *this;
168 }
169 /**
170 * this = this / {s.x, s.y}, component wise.
171 * @param s scale factor
172 * @return this instance
173 */
174 constexpr Vector2F& operator/=(const Vector2F& s) noexcept {
175 x/=s.x; y/=s.y;
176 return *this;
177 }
178
179 /**
180 * this = this * s, component wise.
181 * @param s scale factor
182 * @return this instance
183 */
184 constexpr Vector2F& operator*=(const value_type s) noexcept {
185 x*=s; y*=s;
186 return *this;
187 }
188
189 /**
190 * this = this / s, component wise.
191 * @param s scale factor
192 * @return this instance
193 */
194 constexpr Vector2F& operator/=(const value_type s) noexcept {
195 x/=s; y/=s;
196 return *this;
197 }
198
199 /** Rotates this vector in place, returns *this */
200 constexpr_cxx26 Vector2F& rotate(const value_type radians, const Vector2F& ctr) noexcept {
201 return rotate(std::sin(radians), std::cos(radians), ctr);
202 }
203
204 /** Rotates this vector in place, returns *this */
205 constexpr Vector2F& rotate(const value_type sin, const value_type cos, const Vector2F& ctr) noexcept {
206 const value_type x0 = x - ctr.x;
207 const value_type y0 = y - ctr.y;
208 x = x0 * cos - y0 * sin + ctr.x;
209 y = x0 * sin + y0 * cos + ctr.y;
210 return *this;
211 }
212
213 /** Rotates this vector in place, returns *this */
214 constexpr_cxx26 Vector2F& rotate(const value_type radians) noexcept {
215 return rotate(std::sin(radians), std::cos(radians));
216 }
217
218 /** Rotates this vector in place, returns *this */
219 constexpr Vector2F& rotate(const value_type sin, const value_type cos) noexcept {
220 const value_type x0 = x;
221 x = x0 * cos - y * sin;
222 y = x0 * sin + y * cos;
223 return *this;
224 }
225
226 std::string toString() const noexcept { return std::to_string(x)+", "+std::to_string(y); }
227
228 constexpr bool is_zero() const noexcept {
229 return jau::is_zero(x) && jau::is_zero(y);
230 }
231
232 /**
233 * Return the squared length of this vector, a.k.a the squared <i>norm</i> or squared <i>magnitude</i>
234 */
235 constexpr value_type length_sq() const noexcept {
236 return x*x + y*y;
237 }
238
239 /**
240 * Return the length of this vector, a.k.a the <i>norm</i> or <i>magnitude</i>
241 */
242 constexpr value_type length() const noexcept {
243 return std::sqrt(length_sq());
244 }
245
246 /** Normalize this vector in place, returns *this */
247 constexpr Vector2F& normalize() noexcept {
248 const value_type lengthSq = length_sq();
249 if ( jau::is_zero( lengthSq ) ) {
250 x = zero;
251 y = zero;
252 } else {
253 const value_type invSqr = one / std::sqrt(lengthSq);
254 x *= invSqr;
255 y *= invSqr;
256 }
257 return *this;
258 }
259
260 /**
261 * Return the direction angle of this vector in radians
262 */
264 // Utilize atan2 taking y=sin(a) and x=cos(a), resulting in proper direction angle for all quadrants.
265 return std::atan2( y, x );
266 }
267
268 /**
269 * Return the squared distance between this vector and the given one.
270 * <p>
271 * When comparing the relative distance between two points it is usually sufficient to compare the squared
272 * distances, thus avoiding an expensive square root operation.
273 * </p>
274 */
275 constexpr value_type dist_sq(const Vector2F& o) const noexcept {
276 const value_type dx = x - o.x;
277 const value_type dy = y - o.y;
278 return dx*dx + dy*dy;
279 }
280
281 /**
282 * Return the distance between this vector and the given one.
283 */
284 constexpr value_type dist(const Vector2F& o) const noexcept {
285 return std::sqrt(dist_sq(o));
286 }
287
288 /**
289 * Return the dot product of this vector and the given one
290 * @return the dot product as value_type
291 */
292 constexpr value_type dot(const Vector2F& o) const noexcept {
293 return x*o.x + y*o.y;
294 }
295
296 /**
297 * Returns cross product of this vectors and the given one, i.e. *this x o.
298 *
299 * The 2D cross product is identical with the 2D perp dot product.
300 *
301 * @return the resulting scalar
302 */
303 constexpr value_type cross(const Vector2F& o) const noexcept {
304 return x * o.y - y * o.x;
305 }
306
307 /**
308 * Return the cosines of the angle between two vectors
309 */
310 constexpr value_type cos_angle(const Vector2F& o) const noexcept {
311 return dot(o) / ( length() * o.length() ) ;
312 }
313
314 /**
315 * Return the angle between two vectors in radians
316 */
317 constexpr_cxx26 value_type angle(const Vector2F& o) const noexcept {
318 return std::acos( cos_angle(o) );
319 }
320
321 /**
322 * Return the counter-clock-wise (CCW) normal of this vector, i.e. perp(endicular) vector
323 */
324 constexpr Vector2F normal_ccw() const noexcept {
325 return Vector2F(-y, x);
326 }
327
328 constexpr_cxx23 bool intersects(const Vector2F& o) const noexcept {
329 const value_type eps = std::numeric_limits<value_type>::epsilon();
330 if( std::abs(x-o.x) >= eps || std::abs(y-o.y) >= eps ) {
331 return false;
332 }
333 return true;
334 }
335 };
336
337 template <jau::req::packed_floating_point T>
338 constexpr Vector2F<T> operator+(const Vector2F<T>& lhs, const Vector2F<T>& rhs ) noexcept {
339 // Returning a Vector2F<T> object from the returned reference of operator+=()
340 // may hinder copy-elision or "named return value optimization" (NRVO).
341 // return Vector2F<T>(lhs) += rhs;
342
343 // Returning named object allows copy-elision (NRVO),
344 // only one object is created 'on target'.
345 Vector2F<T> r(lhs); r += rhs; return r;
346 }
347
348 template <jau::req::packed_floating_point T>
349 constexpr Vector2F<T> operator-(const Vector2F<T>& lhs, const Vector2F<T>& rhs ) noexcept {
350 Vector2F<T> r(lhs); r -= rhs; return r;
351 }
352
353 template <jau::req::packed_floating_point T>
354 constexpr Vector2F<T> operator-(const Vector2F<T>& lhs) noexcept {
355 Vector2F<T> r(lhs);
356 r *= -1;
357 return r;
358 }
359
360 template <jau::req::packed_floating_point T>
361 constexpr Vector2F<T> operator*(const Vector2F<T>& lhs, const T s ) noexcept {
362 Vector2F<T> r(lhs); r *= s; return r;
363 }
364
365 template <jau::req::packed_floating_point T>
366 constexpr Vector2F<T> operator*(const T s, const Vector2F<T>& rhs) noexcept {
367 Vector2F<T> r(rhs); r *= s; return r;
368 }
369
370 template <jau::req::packed_floating_point T>
371 constexpr Vector2F<T> operator/(const Vector2F<T>& lhs, const T s ) noexcept {
372 Vector2F<T> r(lhs); r /= s; return r;
373 }
374
375 template <jau::req::packed_floating_point T>
376 constexpr Vector2F<T> operator/(const T s, const Vector2F<T>& rhs) noexcept {
377 Vector2F<T> r(rhs);
378 r.x=s/r.x; r.y=s/r.y;
379 return r;
380 }
381
382 template <jau::req::packed_floating_point T>
383 constexpr Vector2F<T> min(const Vector2F<T>& lhs, const Vector2F<T>& rhs) noexcept {
384 return Vector2F<T>(std::min(lhs.x, rhs.x), std::min(lhs.y, rhs.y));
385 }
386
387 template <jau::req::packed_floating_point T>
388 constexpr Vector2F<T> max(const Vector2F<T>& lhs, const Vector2F<T>& rhs) noexcept {
389 return Vector2F<T>(std::max(lhs.x, rhs.x), std::max(lhs.y, rhs.y));
390 }
391
392 template <jau::req::packed_floating_point T>
393 constexpr Vector2F<T> abs(const Vector2F<T>& lhs) noexcept {
394 return Vector2F<T>(std::abs(lhs.x), std::abs(lhs.y));
395 }
396
397 template <jau::req::packed_floating_point T>
398 std::ostream& operator<<(std::ostream& out, const Vector2F<T>& v) noexcept {
399 return out << v.toString();
400 }
401
402 static_assert(sizeof(float) == alignof(float)); // natural alignment (reconsider otherwise)
403
405 static_assert(2 == Vec2f::components);
406 static_assert(sizeof(float) == Vec2f::value_alignment);
407 static_assert(sizeof(float) == alignof(Vec2f));
408 static_assert(sizeof(float)*2 == Vec2f::byte_size);
409 static_assert(sizeof(float)*2 == sizeof(Vec2f));
410
411 /**
412 * Point2F alias of Vector2F
413 */
414 template <jau::req::packed_floating_point T>
416
418 static_assert(2 == Point2f::components);
419 static_assert(sizeof(float) == Point2f::value_alignment);
420 static_assert(sizeof(float) == alignof(Point2f));
421 static_assert(sizeof(float)*2 == Point2f::byte_size);
422 static_assert(sizeof(float)*2 == sizeof(Point2f));
423
424 /**
425 * Simple compound denoting a ray.
426 *
427 * Component and overall alignment is as sizeof(value_type), i.e. packed.
428 *
429 * A ray, also known as a half line, consists out of it's <i>origin</i>
430 * and <i>direction</i>. Hence it is bound to only the <i>origin</i> side,
431 * where the other end is +infinitive.
432 * <pre>
433 * R(t) = R0 + Rd * t with R0 origin, Rd direction and t > 0.0
434 * </pre>
435 */
436 template <jau::req::packed_floating_point Value_type>
437 class alignas(sizeof(Value_type)) Ray2F {
438 public:
441 typedef const value_type* const_pointer;
442
443 /** value alignment is sizeof(value_type) */
444 constexpr static int value_alignment = sizeof(value_type);
445
446 /** Number of value_type components */
447 constexpr static const size_t components = 4;
448
449 /** Size in bytes with value_alignment */
450 constexpr static const size_t byte_size = components * sizeof(value_type);
451
452 /** Origin of Ray. */
454
455 /** Normalized direction vector of ray. */
457
458 std::string toString() const noexcept { return "Ray[orig "+orig.toString()+", dir "+dir.toString() +"]"; }
459 };
460
461 template <jau::req::packed_floating_point T>
462 std::ostream& operator<<(std::ostream& out, const Ray2F<T>& v) noexcept {
463 return out << v.toString();
464 }
465
467 static_assert(4 == Ray2f::components);
468 static_assert(sizeof(float) == Ray2f::value_alignment);
469 static_assert(sizeof(float) == alignof(Ray2f));
470 static_assert(sizeof(float)*4 == Ray2f::byte_size);
471 static_assert(sizeof(float)*4 == sizeof(Ray2f));
472
473 /**@}*/
474
475} // namespace jau::math
476
477#endif /* JAU_MATH_VEC2F_HPP_ */
Simple compound denoting a ray.
Definition vec2f.hpp:437
static constexpr const size_t byte_size
Definition vec2f.hpp:450
static constexpr const size_t components
Definition vec2f.hpp:447
static constexpr int value_alignment
Definition vec2f.hpp:444
const value_type * const_pointer
Definition vec2f.hpp:441
value_type * pointer
Definition vec2f.hpp:440
Value_type value_type
Definition vec2f.hpp:439
Point2F< value_type > orig
Definition vec2f.hpp:453
std::string toString() const noexcept
Definition vec2f.hpp:458
Vector2F< value_type > dir
Definition vec2f.hpp:456
2D vector using two value_type components.
Definition vec2f.hpp:40
constexpr value_type length() const noexcept
Return the length of this vector, a.k.a the norm or magnitude
Definition vec2f.hpp:242
constexpr Vector2F() noexcept
Definition vec2f.hpp:69
constexpr value_type cross(const Vector2F &o) const noexcept
Returns cross product of this vectors and the given one, i.e.
Definition vec2f.hpp:303
constexpr Vector2F & mul(const Vector2F &s) noexcept
this = this * {s.x, s.y}, component wise.
Definition vec2f.hpp:137
constexpr_cxx26 Vector2F & rotate(const value_type radians, const Vector2F &ctr) noexcept
Rotates this vector in place, returns *this.
Definition vec2f.hpp:200
constexpr reference operator[](size_t i) noexcept
Returns writeable reference to component.
Definition vec2f.hpp:95
constexpr iterator get(iterator xy) const noexcept
xy = this, returns xy.
Definition vec2f.hpp:104
constexpr Vector2F & add(const Vector2F &d) noexcept
this = this + {d.x, d.y}, component wise.
Definition vec2f.hpp:129
constexpr Vector2F & operator/=(const value_type s) noexcept
this = this / s, component wise.
Definition vec2f.hpp:194
constexpr Vector2F & set(const_iterator xy) noexcept
this = xy, returns this.
Definition vec2f.hpp:125
static constexpr int value_alignment
Definition vec2f.hpp:51
constexpr_cxx23 bool intersects(const Vector2F &o) const noexcept
Definition vec2f.hpp:328
constexpr Vector2F & operator-=(const Vector2F &rhs) noexcept
this = this - rhs, component wise.
Definition vec2f.hpp:155
const value_type & const_reference
Definition vec2f.hpp:46
constexpr Vector2F(const value_type v) noexcept
Definition vec2f.hpp:72
constexpr Vector2F & operator=(const Vector2F &) noexcept=default
constexpr bool operator==(const Vector2F &rhs) const noexcept
Definition vec2f.hpp:110
value_type & reference
Definition vec2f.hpp:45
static constexpr const size_t byte_size
Definition vec2f.hpp:57
constexpr Vector2F & rotate(const value_type sin, const value_type cos, const Vector2F &ctr) noexcept
Rotates this vector in place, returns *this.
Definition vec2f.hpp:205
constexpr Vector2F & scale(const value_type s) noexcept
this = this * s, component wise.
Definition vec2f.hpp:145
constexpr Vector2F & add(const value_type dx, const value_type dy) noexcept
this = this + {dx, dy}, component wise.
Definition vec2f.hpp:133
constexpr Vector2F(const value_type x_, const value_type y_) noexcept
Definition vec2f.hpp:75
static constexpr const value_type zero
Definition vec2f.hpp:59
constexpr value_type cos_angle(const Vector2F &o) const noexcept
Return the cosines of the angle between two vectors.
Definition vec2f.hpp:310
constexpr value_type dist(const Vector2F &o) const noexcept
Return the distance between this vector and the given one.
Definition vec2f.hpp:284
constexpr Vector2F & mul(const value_type sx, const value_type sy) noexcept
this = this * {sx, sy}, component wise.
Definition vec2f.hpp:141
constexpr_cxx26 Vector2F & rotate(const value_type radians) noexcept
Rotates this vector in place, returns *this.
Definition vec2f.hpp:214
constexpr Vector2F normal_ccw() const noexcept
Return the counter-clock-wise (CCW) normal of this vector, i.e.
Definition vec2f.hpp:324
static constexpr_cxx26 Vector2F from_length_angle(const value_type magnitude, const value_type radians) noexcept
Definition vec2f.hpp:65
constexpr const_iterator cbegin() const noexcept
Definition vec2f.hpp:92
constexpr Vector2F & rotate(const value_type sin, const value_type cos) noexcept
Rotates this vector in place, returns *this.
Definition vec2f.hpp:219
constexpr value_type dot(const Vector2F &o) const noexcept
Return the dot product of this vector and the given one.
Definition vec2f.hpp:292
constexpr value_type length_sq() const noexcept
Return the squared length of this vector, a.k.a the squared norm or squared magnitude
Definition vec2f.hpp:235
constexpr Vector2F(Vector2F &&o) noexcept=default
constexpr Vector2F & operator/=(const Vector2F &s) noexcept
this = this / {s.x, s.y}, component wise.
Definition vec2f.hpp:174
std::string toString() const noexcept
Definition vec2f.hpp:226
constexpr Vector2F copy() noexcept
Definition vec2f.hpp:83
value_type * iterator
Definition vec2f.hpp:47
constexpr Vector2F & set(const value_type vx, const value_type vy) noexcept
TODO constexpr std::strong_ordering operator<=>(const vec2f_t& rhs) const noexcept { return ....
Definition vec2f.hpp:121
constexpr Vector2F & operator*=(const value_type s) noexcept
this = this * s, component wise.
Definition vec2f.hpp:184
constexpr_cxx26 value_type angle(const Vector2F &o) const noexcept
Return the angle between two vectors in radians.
Definition vec2f.hpp:317
static constexpr const size_t components
Definition vec2f.hpp:54
static constexpr const value_type one
Definition vec2f.hpp:60
value_type * pointer
Definition vec2f.hpp:43
constexpr Vector2F(const Vector2F &o) noexcept=default
constexpr_cxx26 value_type angle() const noexcept
Return the direction angle of this vector in radians.
Definition vec2f.hpp:263
constexpr Vector2F & operator=(Vector2F &&) noexcept=default
constexpr Vector2F & operator+=(const Vector2F &rhs) noexcept
this = this + rhs, component wise.
Definition vec2f.hpp:149
constexpr value_type operator[](size_t i) const noexcept
Returns read-only component.
Definition vec2f.hpp:86
constexpr bool is_zero() const noexcept
Definition vec2f.hpp:228
Value_type value_type
Definition vec2f.hpp:42
constexpr Vector2F & normalize() noexcept
Normalize this vector in place, returns *this.
Definition vec2f.hpp:247
constexpr Vector2F & operator*=(const Vector2F &s) noexcept
this = this * {s.x, s.y}, component wise.
Definition vec2f.hpp:165
const value_type * const_pointer
Definition vec2f.hpp:44
constexpr value_type dist_sq(const Vector2F &o) const noexcept
Return the squared distance between this vector and the given one.
Definition vec2f.hpp:275
const value_type * const_iterator
Definition vec2f.hpp:48
constexpr iterator begin() noexcept
Definition vec2f.hpp:101
#define constexpr_cxx23
#define constexpr_cxx26
constexpr bool is_zero(const T &a, const T &epsilon=std::numeric_limits< T >::epsilon()) noexcept
Returns true if the given value is less than epsilon, w/ epsilon > 0.
constexpr Quaternion< T > operator-(const Quaternion< T > &lhs, const Quaternion< T > &rhs) noexcept
constexpr Matrix4< T > operator*(const Matrix4< T > &lhs, const Matrix4< T > &rhs) noexcept
Definition mat4f.hpp:1949
constexpr Vector2F< T > abs(const Vector2F< T > &lhs) noexcept
Definition vec2f.hpp:393
constexpr Quaternion< T > operator+(const Quaternion< T > &lhs, const Quaternion< T > &rhs) noexcept
constexpr Vector2F< T > max(const Vector2F< T > &lhs, const Vector2F< T > &rhs) noexcept
Definition vec2f.hpp:388
Vector2F< float > Vec2f
Definition vec2f.hpp:404
std::ostream & operator<<(std::ostream &out, const Matrix4< T > &v) noexcept
Definition mat4f.hpp:1964
Point2F< float > Point2f
Definition vec2f.hpp:417
Ray2F< float > Ray2f
Definition vec2f.hpp:466
constexpr Vector2F< T > min(const Vector2F< T > &lhs, const Vector2F< T > &rhs) noexcept
Definition vec2f.hpp:383
Vector2F< T > Point2F
Point2F alias of Vector2F.
Definition vec2f.hpp:415
constexpr Vector2F< T > operator/(const Vector2F< T > &lhs, const T s) noexcept
Definition vec2f.hpp:371
uint8_t Value_type