Skip to content

Commit

Permalink
AP_Math: add F_TO_KELVIN and C_TO_F
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker authored and tridge committed Nov 15, 2023
1 parent 1e5c55b commit e1ea9e4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libraries/AP_Math/definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ static const double WGS84_E = (sqrt(2 * WGS84_F - WGS84_F * WGS84_F));

#define C_TO_KELVIN(temp) (temp + 273.15f)
#define KELVIN_TO_C(temp) (temp - 273.15f)
#define F_TO_KELVIN(temp) C_TO_KELVIN(((temp - 32) * 5/9))
#define F_TO_C(temp) ((temp - 32) * 5/9)
#define F_TO_KELVIN(temp) C_TO_KELVIN(F_TO_C(temp))
#define C_TO_F(temp) ((temp * 9/5) + 32)

#define M_PER_SEC_TO_KNOTS 1.94384449f
#define KNOTS_TO_M_PER_SEC (1/M_PER_SEC_TO_KNOTS)
Expand Down

0 comments on commit e1ea9e4

Please sign in to comment.