EduArt Sensor Ring Library 3.0.1
Loading...
Searching...
No Matches
Vector3.hpp
Go to the documentation of this file.
1// Copyright (c) 2025 EduArt Robotik GmbH
2
9
10#pragma once
11
12#include <array>
13#include <cmath>
14
16
17namespace eduart {
18
19namespace math {
20
25struct SENSORRING_API Vector3 {
27 std::array<double, 3> data;
28
30 double& x();
31
33 const double& x() const;
34
36 double& y();
37
39 const double& y() const;
40
42 double& z();
43
45 const double& z() const;
46
48 double& operator[](std::size_t idx);
49
51 const double& operator[](std::size_t idx) const;
52
54 Vector3 operator+(const Vector3& other) const;
55
57 Vector3& operator+=(const Vector3& other);
58
60 Vector3 operator-(const Vector3& other) const;
61
63 Vector3& operator-=(const Vector3& other);
64
66 Vector3 operator*(const double& other) const;
67
69 Vector3& operator*=(const double& other);
70
72 Vector3 operator/(const double& other) const;
73
75 Vector3& operator/=(const double& other);
76
78 double abs() const;
79};
80
81} // namespace math
82
83} // namespace eduart
Control the import and export of Windows DLL symbols.
Vector of length 3.
Definition Vector3.hpp:25
double & x()
First component of the vector.
double & operator[](std::size_t idx)
Indexing the Matrix.
Vector3 operator+(const Vector3 &other) const
Vector addition.
Vector3 operator/(const double &other) const
Vector-Scalar division.
const double & y() const
Second component of the vector.
double abs() const
Get the length of the vector.
Vector3 & operator/=(const double &other)
Vector-Scalar division.
Vector3 & operator+=(const Vector3 &other)
Vector addition.
Vector3 & operator*=(const double &other)
Vector-Scalar multiplication.
Vector3 operator-(const Vector3 &other) const
Vector subtraction.
const double & z() const
Third component of the vector.
const double & x() const
First component of the vector.
double & y()
Second component of the vector.
const double & operator[](std::size_t idx) const
Indexing the Matrix.
Vector3 operator*(const double &other) const
Vector-Scalar multiplication.
double & z()
Third component of the vector.
Vector3 & operator-=(const Vector3 &other)
Vector subtraction.
std::array< double, 3 > data
Data structure of the Vector 3.
Definition Vector3.hpp:27