Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
Vector.cpp
Go to the documentation of this file.
1#include "Vector.hpp"
2
4#ifndef ARDUINO
5#include <ostream> // std::ostream, <<
6#endif
7
9
10// LCOV_EXCL_START
11
12#ifndef ARDUINO
13
16std::ostream &operator<<(std::ostream &os, Vec2f v) {
17 return os << "(" << v.x << ", " << v.y << ")";
18}
19
22std::ostream &operator<<(std::ostream &os, Vec3f v) {
23 return os << "(" << v.x << ", " << v.y << ", " << v.z << ")";
24}
25
26#endif
27
30Print &operator<<(Print &os, Vec2f v) {
31 return os << "(" << v.x << ", " << v.y << ")";
32}
33
36Print &operator<<(Print &os, Vec3f v) {
37 return os << "(" << v.x << ", " << v.y << ", " << v.z << ")";
38}
39
40// LCOV_EXCL_STOP
41
#define END_AH_NAMESPACE
#define BEGIN_AH_NAMESPACE
Definition of Vec2f and Vec3f.
std::enable_if_t< std::is_arithmetic< T >::value, Print & > operator<<(Print &os, const AH::ArraySlice< T, N, Reverse, Const > &a)
Type for 2D vectors of floating point numbers.
Definition Vector.hpp:39
float y
The y component of the vector.
Definition Vector.hpp:41
Print & operator<<(Print &os, Vec2f v)
Printing.
Definition Vector.cpp:30
float x
The x component of the vector.
Definition Vector.hpp:40
Vec2f()=default
Create a vector that is initialized to the zero vector (0,0).
Type for 3D vectors of floating point numbers.
Definition Vector.hpp:140
Print & operator<<(Print &os, Vec3f v)
Printing.
Definition Vector.cpp:36
float y
The y component of the vector.
Definition Vector.hpp:142
Vec3f()=default
Create a vector that is initialized to the zero vector (0,0,0).
float x
The x component of the vector.
Definition Vector.hpp:141
float z
The z component of the vector.
Definition Vector.hpp:143