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{
14
15 struct Q;
16
18 struct AA
19 {
22
25
26 AA(const n3 &ax, const An &ang);
27
28 [[nodiscard]] static AA from(const Q& q);
29 };
30
32 struct Ypr
33 {
36
39
42
43 [[nodiscard]] static Ypr from(const Q& q);
44 };
45
46 [[nodiscard]] AA
47 rha(const n3& axis, const An& angle);
48
49 std::string string_from(const AA &aa);
50 std::string string_from(const Ypr& ypr);
51
53
56}
57
58ADD_DEFAULT_FORMATTER(eu::AA, std::string, eu::string_from);
59ADD_DEFAULT_FORMATTER(eu::Ypr, std::string, eu::string_from);
#define ADD_CATCH_FORMATTER_DEF(TYPE)
Definition pch.public.h:42
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
static AA from(const Q &q)
An angle
rotation according to right-hand rule
Definition axisangle.h:24
n3 axis
a unit-vector
Definition axisangle.h:21
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
static Ypr from(const Q &q)
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