RoboidControl
Loading...
Searching...
No Matches
Angle.h
Go to the documentation of this file.
1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0.If a copy of the MPL was not distributed with this
3// file, You can obtain one at https ://mozilla.org/MPL/2.0/.
4
5#ifndef ANGLE_H
6#define ANGLE_H
7
8namespace Passer {
9namespace LinearAlgebra {
10
11template <typename T> class AngleOf {
12public:
14 AngleOf(T v) : value(v) {}
15 operator T() const { return value; }
16
19
20 static AngleOf<T> pi;
21
23
27 AngleOf<T> r = Normalize(b - a);
28 return r;
29 };
30 static AngleOf<T> MoveTowards(AngleOf<T> fromAngle, AngleOf<T> toAngle,
31 AngleOf<T> maxAngle);
32
33 static AngleOf<T> CosineRuleSide(float a, float b, AngleOf<T> gamma);
34 static AngleOf<T> CosineRuleAngle(float a, float b, float c);
35
36 static AngleOf<T> SineRuleAngle(float a, AngleOf<T> beta, float c);
37
38private:
39 T value;
40};
41
43
44} // namespace LinearAlgebra
45} // namespace Passer
46using namespace Passer::LinearAlgebra;
47
48#endif
Definition Angle.h:11
static AngleOf< T > Clamp(AngleOf< T > a, AngleOf< T > min, AngleOf< T > max)
static AngleOf< T > Normalize(AngleOf< T > a)
AngleOf()
Definition Angle.h:13
AngleOf(T v)
Definition Angle.h:14
static AngleOf< T > CosineRuleSide(float a, float b, AngleOf< T > gamma)
static AngleOf< T > Deg2Rad
Definition Angle.h:18
static AngleOf< T > Rad2Deg
Definition Angle.h:17
static AngleOf< T > SineRuleAngle(float a, AngleOf< T > beta, float c)
static AngleOf< T > Difference(AngleOf< T > a, AngleOf< T > b)
Definition Angle.h:26
bool operator==(AngleOf< T > a)
static AngleOf< T > MoveTowards(AngleOf< T > fromAngle, AngleOf< T > toAngle, AngleOf< T > maxAngle)
static AngleOf< T > pi
Definition Angle.h:20
static AngleOf< T > CosineRuleAngle(float a, float b, float c)
Definition Angle.h:9
Definition AbsoluteEncoder.h:5