cisst-saw
|
Declaration of units and unit conversion methodsThis file include the definition and implementation of constants and global functions used to defines measuring units in the cisst libraries. The internal units of the cisst libraries are meters, kilograms, seconds and radians if CISST_USE_SI_UNITS is set to true. Otherwise, units are millimeters and grams. Older versions of cisst didn't define CISST_USE_SI_UNITS and the default units were millimeters and grams. More...
Go to the source code of this file.
Macros | |
#define | _cmnUnits_h |
Length units. The internal unit is millimeter if | |
const double | cmn_mm = 1.0 |
const double | cmn_um = cmn_mm / 1000.0 |
const double | cmn_cm = 10.0 * cmn_mm |
const double | cmn_m = 1000.0 |
const double | cmn_km = 1000.0 * cmn_m |
double | cmnInternalTo_mm (double valueInternalUnits) |
double | cmnInternalTo_um (double valueInternalUnits) |
double | cmnInternalTo_cm (double valueInternalUnits) |
double | cmnInternalTo_m (double valueInternalUnits) |
double | cmnInternalTo_km (double valueInternalUnits) |
Mass units. The internal unit is grams if | |
const double | cmn_g = 1.0 |
const double | cmn_mg = cmn_g / 1000.0 |
const double | cmn_ug = cmn_mg / 1000.0 |
const double | cmn_cg = cmn_g / 100.0 |
const double | cmn_kg = 1000.0 * cmn_g |
double | cmnInternalTo_g (double valueInternalUnits) |
double | cmnInternalTo_mg (double valueInternalUnits) |
double | cmnInternalTo_ug (double valueInternalUnits) |
double | cmnInternalTo_cg (double valueInternalUnits) |
double | cmnInternalTo_kg (double valueInternalUnits) |
Time units. The internal unit is seconds. | |
const double | cmn_s = 1.0 |
const double | cmn_ms = cmn_s / 1000.0 |
const double | cmn_us = cmn_ms / 1000.0 |
const double | cmn_ns = cmn_us / 1000.0 |
const double | cmn_minute = 60.0 * cmn_s |
const double | cmn_hour = 60.0 * cmn_minute |
const double | cmn_day = 24.0 * cmn_hour |
double | cmnInternalTo_s (double valueInternalUnits) |
double | cmnInternalTo_ms (double valueInternalUnits) |
double | cmnInternalTo_us (double valueInternalUnits) |
double | cmnInternalTo_ns (double valueInternalUnits) |
double | cmnInternalTo_minute (double valueInternalUnits) |
double | cmnInternalTo_hour (double valueInternalUnits) |
double | cmnInternalTo_day (double valueInternalUnits) |
Declaration of units and unit conversion methods
This file include the definition and implementation of constants and global functions used to defines measuring units in the cisst libraries. The internal units of the cisst libraries are meters, kilograms, seconds and radians if CISST_USE_SI_UNITS is set to true. Otherwise, units are millimeters and grams. Older versions of cisst didn't define CISST_USE_SI_UNITS and the default units were millimeters and grams.
For all units, the cisst libraries provide a constant as well as a global function to convert from the internal units to other representations.
double distance = 5000 * cmn_m; // 5000 meters AnExampleOfFunction(50 * cmn_mm); // 50 millimeters std::cout << "distance in cm: " << cmnInternalTo_cm(distance) << std::endl;
#define _cmnUnits_h |
|
inline |
Convert a mass in internal units to centigrams
|
inline |
Convert a length in internal units to centimeters
|
inline |
Convert a time in internal units to days
|
inline |
Convert a mass in internal units to grams
|
inline |
Convert a time in internal units to hours
|
inline |
Convert a mass in internal units to kilograms
|
inline |
Convert a length in internal units to kilometers
|
inline |
Convert a length in internal units to meters
|
inline |
Convert a mass in internal units to milligrams
|
inline |
Convert a time in internal units to minutes
|
inline |
Convert a length in internal units to millimeters
|
inline |
Convert a time in internal units to milliseconds
|
inline |
Convert a time in internal units to nanoseconds
|
inline |
Convert a time in internal units to seconds
|
inline |
Convert a mass in internal units to micrograms
|
inline |
Convert a length in internal units to micrometers
|
inline |
Convert a time in internal units to microseconds
const double cmn_cg = cmn_g / 100.0 |
Centigram constant, use to convert a mass in centigrams to internal units.
const double cmn_cm = 10.0 * cmn_mm |
Centimeter constant, use to convert a length in centimeters to internal units.
const double cmn_day = 24.0 * cmn_hour |
Days constant, use to convert a time in days to internal units.
const double cmn_g = 1.0 |
Gram constant, use to convert a mass in grams to internal units.
const double cmn_hour = 60.0 * cmn_minute |
Hours constant, use to convert a time in hours to internal units.
const double cmn_kg = 1000.0 * cmn_g |
Kilogram constant, use to convert a mass in kilograms to internal units.
const double cmn_km = 1000.0 * cmn_m |
Kilometer constant, use to convert a length in kilometers to internal units.
const double cmn_m = 1000.0 |
Meter constant, use to convert a length in meters to internal units.
const double cmn_mg = cmn_g / 1000.0 |
Milligrams constant, use to convert a mass in milligrams to internal units.
const double cmn_minute = 60.0 * cmn_s |
Minutes constant, use to convert a time in minutes to internal units.
const double cmn_mm = 1.0 |
Millimeter constant, use to convert a length in millimeters to internal units.
const double cmn_ms = cmn_s / 1000.0 |
Milliseconds constant, use to convert a time in milliseconds to internal units.
const double cmn_ns = cmn_us / 1000.0 |
Nanosecond constant, use to convert a time in nanoseconds to internal units.
const double cmn_s = 1.0 |
Second constant, use to convert a time in seconds to internal units.
const double cmn_ug = cmn_mg / 1000.0 |
Microgram constant, use to convert a mass in micrograms to internal units.
const double cmn_um = cmn_mm / 1000.0 |
Micrometer constant, use to convert a length in micrometers to internal units.
const double cmn_us = cmn_ms / 1000.0 |
Microsecond constant, use to convert a time in microseconds to internal units.