# VectorNav C++ Library: include/vn/conversions.h Source File

conversions.h
#ifndef _VN_MATH_CONVERSIONS_H_
#define _VN_MATH_CONVERSIONS_H_
#include "export.h"
#include "vector.h"
#include "matrix.h"
namespace vn {
namespace math {
float rad2deg(float angleInRads);
double rad2deg(double angleInRads);
template<size_t dim>
vec<dim, float> rad2deg(vec<dim> anglesInRads)
{
for (size_t i = 0; i < dim; i++)
anglesInRads[i] = rad2deg(anglesInRads[i]);
return anglesInRads;
}
float vn_proglib_DLLEXPORT deg2rad(float angleInDegs);
double vn_proglib_DLLEXPORT deg2rad(double angleInDegs);
//template<size_t dim>
//vec<dim, float> vn_proglib_DLLEXPORT deg2rad(vec<dim> anglesInDegs)
template<size_t dim>
vec<dim, float> deg2rad(vec<dim> anglesInDegs)
{
for (size_t i = 0; i < dim; i++)
anglesInDegs[i] = deg2rad(anglesInDegs[i]);
return anglesInDegs;
}
float celsius2fahren(float tempInCelsius);
double celsius2fahren(double tempInCelsius);
float fahren2celsius(float tempInFahren);
double fahren2celsius(double tempInFahren);
float celsius2kelvin(float tempInCelsius);
double celsius2kelvin(double tempInCelsius);
float kelvin2celsius(float tempInKelvin);
double kelvin2celsius(double tempInKelvin);
float fahren2kelvin(float tempInFahren);
double fahren2kelvin(double tempInFahren);
float kelvin2fahren(float tempInKelvin);
double kelvin2fahren(double tempInKelvin);
vec4f yprInDegs2Quat(vec3f yprInDegs);
vec4f yprInRads2Quat(vec3f yprInRads);
mat3f yprInDegs2Dcm(vec3f yprInDegs);
mat3f yprInRads2Dcm(vec3f yprInRads);
vec3f quat2YprInDegs(vec4f quat);
vec3f quat2YprInRads(vec4f quat);
mat3f quat2dcm(vec4f quat);
vec3f dcm2YprInDegs(mat3f dcm);
vec3f dcm2YprInRads(mat3f dcm);
vec4f dcm2quat(mat3f dcm);
float vn_proglib_DLLEXPORT course_over_ground(float velNedX, float velNedY);
float vn_proglib_DLLEXPORT course_over_ground(vec3f velNed);
float vn_proglib_DLLEXPORT speed_over_ground(float velNedX, float velNedY);
float vn_proglib_DLLEXPORT speed_over_ground(vec3f velNed);
vec3f vn_proglib_DLLEXPORT quat2omegaPhiKappaInRads(vec4f quat);
vec3f vn_proglib_DLLEXPORT dcm2omegaPhiKappaInRads(mat3f dcm);
vec3f vn_proglib_DLLEXPORT yprInDegs2omegaPhiKappaInRads(vec3f yprDegs);
vec3f vn_proglib_DLLEXPORT yprInRads2omegaPhiKappaInRads(vec3f yprRads);
}
}
#endif
vn::math::deg2rad
vec< dim, float > deg2rad(vec< dim > anglesInDegs)
Convers a vector of angles in degrees to radians.
Definition: conversions.h:59
vn::math::fahren2kelvin
double fahren2kelvin(double tempInFahren)
Converts a temperature in Fahrenheit to Kelvin.
vn::math::vec
Template for a Euclidean vector.
Definition: vector.h:22
vn::math::kelvin2celsius
double kelvin2celsius(double tempInKelvin)
Converts a temperature in Kelvin to Celsius.
vn::math::celsius2fahren
double celsius2fahren(double tempInCelsius)
Converts a temperature in Celsius to Fahrenheit.
vn::math::fahren2celsius
double fahren2celsius(double tempInFahren)
Converts a temperature in Fahrenheit to Celsius.
matrix.h
vn::math::rad2deg
vec< dim, float > rad2deg(vec< dim > anglesInRads)
Convers a vector of angles in radians to degrees.
Definition: conversions.h:32
vn::math::kelvin2fahren
double kelvin2fahren(double tempInKelvin)
Converts a temperature in Kelvin to Fahrenheit.
vector.h
vn
Definition: attitude.h:8
vn::math::celsius2kelvin
double celsius2kelvin(double tempInCelsius)
Converts a temperature in Celsius to Kelvin.