$search
Units conversion constants and functions. More...
#include <math.h>
#include <sys/time.h>
#include <time.h>
Go to the source code of this file.
Functions | |
static int | analog_to_digital (double voltage, double maxvolts, int nbits) |
static double | analog_volts (int data, double maxvolts, int nbits) |
static double | feet2meters (double feet) |
static double | kmph2mmps (double kmph) |
static double | meters2feet (double meters) |
static double | mmps2mph (double mm) |
static double | mph2mmps (double mph) |
static double | mph2mps (double mph) |
static double | mps2mph (double mps) |
static double | tv2secs (struct timeval *tv) |
Variables | |
const double | CM_PER_INCH = 2.54 |
const double | CM_PER_METER = 100.0 |
const double | DEGREES_PER_RADIAN = 180.0/M_PI |
const double | HALFPI = M_PI / 2.0 |
const double | INCHES_PER_FOOT = 12.0 |
const double | METERS_PER_FOOT = INCHES_PER_FOOT * CM_PER_INCH / CM_PER_METER |
const double | METERS_PER_MILE = MMETERS_PER_MILE / 1000.0 |
const long | MINUTES_PER_HOUR = 60 |
const double | MMETERS_PER_KM = 1000000.0 |
const double | MMETERS_PER_MILE = 1609344.0 |
const double | RADIANS_PER_DEGREE = M_PI/180.0 |
const long | SECONDS_PER_HOUR = SECONDS_PER_MINUTE * MINUTES_PER_HOUR |
const long | SECONDS_PER_MINUTE = 60 |
const double | TWOPI = 2.0 * M_PI |
Units conversion constants and functions.
Definition in file conversions.h.
static int analog_to_digital | ( | double | voltage, | |
double | maxvolts, | |||
int | nbits | |||
) | [inline, static] |
convert analog voltage corresponding digital encoding
Definition at line 101 of file conversions.h.
static double analog_volts | ( | int | data, | |
double | maxvolts, | |||
int | nbits | |||
) | [inline, static] |
convert analog input data to corresponding voltage
Definition at line 92 of file conversions.h.
static double feet2meters | ( | double | feet | ) | [inline, static] |
convert from feet to meters
Definition at line 74 of file conversions.h.
static double kmph2mmps | ( | double | kmph | ) | [inline, static] |
Definition at line 51 of file conversions.h.
static double meters2feet | ( | double | meters | ) | [inline, static] |
convert from meters to feet
Definition at line 80 of file conversions.h.
static double mmps2mph | ( | double | mm | ) | [inline, static] |
convert between millimeters per second and miles per hour
Definition at line 46 of file conversions.h.
static double mph2mmps | ( | double | mph | ) | [inline, static] |
Definition at line 56 of file conversions.h.
static double mph2mps | ( | double | mph | ) | [inline, static] |
convert between meters per second and miles per hour
Definition at line 62 of file conversions.h.
static double mps2mph | ( | double | mps | ) | [inline, static] |
convert from meters per second to miles per hour
Definition at line 68 of file conversions.h.
static double tv2secs | ( | struct timeval * | tv | ) | [inline, static] |
convert timeval to seconds
Definition at line 86 of file conversions.h.
const double CM_PER_INCH = 2.54 |
Definition at line 28 of file conversions.h.
const double CM_PER_METER = 100.0 |
Definition at line 29 of file conversions.h.
const double DEGREES_PER_RADIAN = 180.0/M_PI |
Definition at line 38 of file conversions.h.
const double HALFPI = M_PI / 2.0 |
Definition at line 42 of file conversions.h.
const double INCHES_PER_FOOT = 12.0 |
Unit conversion constants:
Definition at line 27 of file conversions.h.
const double METERS_PER_FOOT = INCHES_PER_FOOT * CM_PER_INCH / CM_PER_METER |
Definition at line 30 of file conversions.h.
const double METERS_PER_MILE = MMETERS_PER_MILE / 1000.0 |
Definition at line 33 of file conversions.h.
const long MINUTES_PER_HOUR = 60 |
Definition at line 35 of file conversions.h.
const double MMETERS_PER_KM = 1000000.0 |
Definition at line 31 of file conversions.h.
const double MMETERS_PER_MILE = 1609344.0 |
Definition at line 32 of file conversions.h.
const double RADIANS_PER_DEGREE = M_PI/180.0 |
Definition at line 37 of file conversions.h.
const long SECONDS_PER_HOUR = SECONDS_PER_MINUTE * MINUTES_PER_HOUR |
Definition at line 36 of file conversions.h.
const long SECONDS_PER_MINUTE = 60 |
Definition at line 34 of file conversions.h.
const double TWOPI = 2.0 * M_PI |
Useful constants
Definition at line 41 of file conversions.h.