mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 12:03:33 +08:00
geo_lookup: move tables to separate file
This commit is contained in:
+5
-5
@@ -57,27 +57,27 @@
|
||||
|
||||
namespace math {
|
||||
template <typename Type>
|
||||
Type min(Type val1, Type val2) {
|
||||
static constexpr Type min(Type val1, Type val2) {
|
||||
return (val1 < val2) ? val1 : val2;
|
||||
}
|
||||
|
||||
template <typename Type>
|
||||
Type max(Type val1, Type val2) {
|
||||
static constexpr Type max(Type val1, Type val2) {
|
||||
return (val1 > val2) ? val1 : val2;
|
||||
}
|
||||
|
||||
template <typename Type>
|
||||
Type constrain(Type val, Type min, Type max) {
|
||||
static constexpr Type constrain(Type val, Type min, Type max) {
|
||||
return (val < min) ? min : ((val > max) ? max : val);
|
||||
}
|
||||
|
||||
template <typename Type>
|
||||
Type radians(Type degrees) {
|
||||
static constexpr Type radians(Type degrees) {
|
||||
return (degrees / Type(180)) * Type(M_PI);
|
||||
}
|
||||
|
||||
template <typename Type>
|
||||
Type degrees(Type radians) {
|
||||
static constexpr Type degrees(Type radians) {
|
||||
return (radians * Type(180)) / Type(M_PI);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user