|
M5Unit-IMU 0.0.2 git rev:e5b00aa
|
Plain 3D vector (float) More...
#include <vector3.hpp>
Public Member Functions | |
| constexpr | Vector3 (const float x_, const float y_, const float z_) |
| Construct from components. | |
| Vector3 | operator+ (const Vector3 &rhs) const |
| Component-wise addition. | |
| Vector3 | operator- (const Vector3 &rhs) const |
| Component-wise subtraction. | |
| Vector3 | operator* (const float scalar) const |
| Scalar multiplication. | |
| float | dot (const Vector3 &rhs) const |
| Dot product. | |
| Vector3 | cross (const Vector3 &rhs) const |
| Cross product (right-handed) | |
| float | norm () const |
| Euclidean norm (magnitude) | |
| bool | normalize () |
| Normalize this vector in place. | |
| Vector3 | normalized () const |
| Return a normalized copy (zero vector maps to zero vector) | |
Public Attributes | |
| float | x {} |
| X component. | |
| float | y {} |
| Y component. | |
| float | z {} |
| Z component. | |
Plain 3D vector (float)
|
inline |
Normalize this vector in place.