EduArt Sensor Ring Library 4.0.0
Loading...
Searching...
No Matches
Vector3.hpp
Go to the documentation of this file.
1// Copyright (c) 2026 EduArt Robotik GmbH
2
9
10#pragma once
11
12#include <array>
13#include <cmath>
14
15#include "sensorring/platform/SensorringExport.hpp"
16
17namespace eduart {
18
19namespace sensorring {
20
21namespace math {
22
27struct SENSORRING_EXPORT Vector3 {
29 std::array<double, 3> data;
30
32 double& x();
33
35 const double& x() const;
36
38 double& y();
39
41 const double& y() const;
42
44 double& z();
45
47 const double& z() const;
48
50 double& operator[](std::size_t idx);
51
53 const double& operator[](std::size_t idx) const;
54
56 Vector3 operator+(const Vector3& other) const;
57
59 Vector3& operator+=(const Vector3& other);
60
62 Vector3 operator-(const Vector3& other) const;
63
65 Vector3& operator-=(const Vector3& other);
66
68 Vector3 operator*(const double& other) const;
69
71 Vector3& operator*=(const double& other);
72
74 Vector3 operator/(const double& other) const;
75
77 Vector3& operator/=(const double& other);
78
80 double abs() const;
81};
82
83} // namespace math
84
85} // namespace sensorring
86
87} // namespace eduart
Vector of length 3.
Definition Vector3.hpp:27
const double & operator[](std::size_t idx) const
Indexing the vector.
double & z()
Third component of the vector.
Vector3 & operator-=(const Vector3 &other)
Vector subtraction.
double abs() const
Get the length of the vector.
double & x()
First component of the vector.
Vector3 operator+(const Vector3 &other) const
Vector addition.
const double & z() const
Third component of the vector.
std::array< double, 3 > data
Data structure of the Vector 3.
Definition Vector3.hpp:29
Vector3 & operator*=(const double &other)
Vector-Scalar multiplication.
Vector3 & operator/=(const double &other)
Vector-Scalar division.
Vector3 operator*(const double &other) const
Vector-Scalar multiplication.
const double & x() const
First component of the vector.
double & y()
Second component of the vector.
Vector3 operator/(const double &other) const
Vector-Scalar division.
double & operator[](std::size_t idx)
Indexing the vector.
Vector3 operator-(const Vector3 &other) const
Vector subtraction.
const double & y() const
Second component of the vector.
Vector3 & operator+=(const Vector3 &other)
Vector addition.