RoboidControl-cpp/AngleAxis.h
2024-09-16 15:21:16 +02:00

43 lines
971 B
C++

// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0.If a copy of the MPL was not distributed with this
// file, You can obtain one at https ://mozilla.org/MPL/2.0/.
#ifndef ANGLEAXIS_H
#define ANGLEAXIS_H
#include "Angle.h"
#include "Direction.h"
#include "Quaternion.h"
namespace Passer {
namespace LinearAlgebra {
// Isn't this the same as SphericalOf<T> ?????????????
template <typename T>
class AngleAxisOf {
public:
float angle;
DirectionOf<T> axis;
AngleAxisOf();
AngleAxisOf(float angle, DirectionOf<T> axis);
AngleAxisOf(Quaternion q);
AngleAxisOf(float angle, Vector3 axis);
const static AngleAxisOf<T> zero;
Quaternion ToQuaternion();
DirectionOf<T> GetSwing();
};
using AngleAxisSingle = AngleAxisOf<float>;
using AngleAxis16 = AngleAxisOf<signed short>;
using AngleAxis = AngleAxisOf<float>;
} // namespace LinearAlgebra
} // namespace Passer
using namespace Passer::LinearAlgebra;
#endif