LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
light::units Namespace Reference

Single source of truth for unit conversions. More...

Variables

constexpr double MM_PER_IN = 25.4
 Millimeters per inch.
 
constexpr double IN_PER_MM = 1.0 / 25.4
 Inches per millimeter.
 
constexpr double M_PER_IN = 0.0254
 Meters per inch.
 
constexpr double IN_PER_M = 1.0 / 0.0254
 Inches per meter.
 
constexpr double DEG_PER_RAD = 180.0 / M_PI
 Degrees per radian.
 
constexpr double RAD_PER_DEG = M_PI / 180.0
 Radians per degree.
 

Detailed Description

Single source of truth for unit conversions.

Multiplying is faster and clearer than repeating the magic literals (25.4, 0.0254, M_PI/180) inline.

Variable Documentation

◆ DEG_PER_RAD

constexpr double light::units::DEG_PER_RAD = 180.0 / M_PI
inlineconstexpr

Degrees per radian.

Definition at line 164 of file util.hpp.

◆ IN_PER_M

constexpr double light::units::IN_PER_M = 1.0 / 0.0254
inlineconstexpr

Inches per meter.

Definition at line 163 of file util.hpp.

◆ IN_PER_MM

constexpr double light::units::IN_PER_MM = 1.0 / 25.4
inlineconstexpr

Inches per millimeter.

Definition at line 161 of file util.hpp.

◆ M_PER_IN

constexpr double light::units::M_PER_IN = 0.0254
inlineconstexpr

Meters per inch.

Definition at line 162 of file util.hpp.

◆ MM_PER_IN

constexpr double light::units::MM_PER_IN = 25.4
inlineconstexpr

Millimeters per inch.

Definition at line 160 of file util.hpp.

◆ RAD_PER_DEG

constexpr double light::units::RAD_PER_DEG = M_PI / 180.0
inlineconstexpr

Radians per degree.

Definition at line 165 of file util.hpp.