amino
Lightweight Robot Utility Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
unit.h
1 /* -*- mode: C; c-basic-offset: 4 -*- */
2 /* ex: set shiftwidth=4 tabstop=4 expandtab: */
3 /*
4  * Copyright (c) 2010-2011, Georgia Tech Research Corporation
5  * All rights reserved.
6  *
7  * Author(s): Neil T. Dantam <ntd@gatech.edu>
8  * Georgia Tech Humanoid Robotics Lab
9  * Under Direction of Prof. Mike Stilman <mstilman@cc.gatech.edu>
10  *
11  *
12  * This file is provided under the following "BSD-style" License:
13  *
14  *
15  * Redistribution and use in source and binary forms, with or
16  * without modification, are permitted provided that the following
17  * conditions are met:
18  *
19  * * Redistributions of source code must retain the above copyright
20  * notice, this list of conditions and the following disclaimer.
21  *
22  * * Redistributions in binary form must reproduce the above
23  * copyright notice, this list of conditions and the following
24  * disclaimer in the documentation and/or other materials provided
25  * with the distribution.
26  *
27  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
28  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
29  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
31  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
32  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
35  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
36  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
38  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39  * POSSIBILITY OF SUCH DAMAGE.
40  *
41  */
42 
43 
44 #ifndef AMINO_UNIT_H
45 #define AMINO_UNIT_H
46 
47 // for all constants, MKS_VALUE = XXX_VALUE * AA_UCONV_XXX
48 
49 // length
50 #define AA_UCONV_INCH 2.54e-2
51 #define AA_UCONV_FOOT 3.048e-1
52 #define AA_UCONV_YARD 9.144e-1
53 #define AA_UCONV_MILE 1.609344e3
54 #define AA_UCONV_ANGSTROM 1e-10
55 #define AA_UCONV_FURLONG 2.0117e2
56 #define AA_UCONV_FATHOM 1.8288e0
57 
58 // mass
59 #define AA_UCONV_POUND_MASS 4.5359e-1
60 #define AA_UCONV_SLUG 1.4594e1
61 #define AA_UCONV_TON_SHORT 9.07018474e2
62 #define AA_UCONV_TON_LONG 1.016004691e3
63 #define AA_UCONV_TON_METRIC 1e3
64 #define AA_UCONV_OUNCE 2.83495231e-2
65 #define AA_UCONV_STONE 6.35029318e0
66 #define AA_UCONV_GRAIN 6.479891e-5
67 
68 // time
69 #define AA_UCONV_HOUR 3.6e3
70 #define AA_UCONV_FORTNIGHT 1.209600e6
71 
72 // angle
73 #define AA_UCONV_DEGREE (M_PI/180.0)
74 
75 // area
76 #define AA_UCONV_ACRE 4.0469e3
77 
78 // volume
79 #define AA_UCONV_GALLON 3.7854e-3
80 #define AA_UCONV_BUSHEL 3.5239e-2
81 #define AA_UCONV_FLUID_OUNCE 2.95735296e-5
82 
83 // charge
84 #define AA_UCONV_AMP_HOUR 3.6e3
85 
86 // force
87 #define AA_UCONV_POUND_FORCE 4.4482e0
88 
89 // pressure
90 #define AA_UCONV_PSI 6.8948e3
91 #define AA_UCONV_ATM 1.0133e5
92 #define AA_UCONV_BAR 1e5
93 #define AA_UCONV_MMHG 1.33322368e2
94 
95 // energy
96 #define AA_UCONV_BTU 1.0551e3
97 #define AA_UCONV_KILOWATT_HOUR 3.6e6
98 
99 // energy/torque
100 #define AA_UCONV_FOOT_POUND 1.3558e0
101 
102 // power
103 #define AA_UCONV_HORSEPOWER 7.4570e2
104 #define AA_UCONV_BTU_PER_HOUR 2.9288e-1
105 #define AA_UCONV_BTU_PER_MINUTE 1.7573e1
106 
107 
108 #define AA_UCONV_DEGREE (M_PI/180.0)
109 
110 
111 
112 #endif //AMINO_UNIT_H