Euphoria
axisangle.h
Go to the documentation of this file.
1#pragma once
2
3#include <iostream>
4
5#include "eu/base/vec3.h"
6#include "eu/base/angle.h"
7
8
9namespace eu
10{
15 struct Q;
16
18 struct AA
19 {
22
25
26 AA(const n3 &ax, const An &ang);
27
28 [[nodiscard]] static std::optional<AA> from(const Q& q);
29 };
30
32 struct Ypr
33 {
36
39
42 };
43
44 [[nodiscard]] AA
45 rha(const n3& axis, const An& angle);
46
47 std::string string_from(const AA &aa);
48 std::string string_from(const Ypr& ypr);
49
54}
55
56ADD_DEFAULT_FORMATTER(eu::AA, std::string, eu::string_from);
57ADD_DEFAULT_FORMATTER(eu::Ypr, std::string, eu::string_from);
#define ADD_CATCH_FORMATTER_DEF(TYPE)
Definition pch.public.h:22
AA rha(const n3 &axis, const An &angle)
constexpr An no_rotation
Definition angle.h:89
std::string string_from(const An &a)
Definition assert.h:118
Axis + Angle.
Definition axisangle.h:19
An angle
rotation according to right-hand rule
Definition axisangle.h:24
n3 axis
a unit-vector
Definition axisangle.h:21
static std::optional< AA > from(const Q &q)
AA(const n3 &ax, const An &ang)
An angle in both degrees and radians.
Definition angle.h:13
A quaternion representing a rotation in 3d.
Definition quat.h:19
yaw + pitch + roll
Definition axisangle.h:33
An pitch
up and down rotation, positive up
Definition axisangle.h:38
An yaw
left and right rotation, positive right
Definition axisangle.h:35
An roll
tilting rotation, positive tilting right/clockwise/right hand rule
Definition axisangle.h:41
a 3d unit (vector)
Definition vec3.h:94