alchemist 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,25 @@
1
+ module Alchemist
2
+ def self.binary_prefixes
3
+ {
4
+ :yotta => 2.0**80.0, :Y => 2.0**80,
5
+ :zetta => 2.0**70.0, :Z => 2.0**70.0,
6
+ :exa => 2.0**60.0, :E => 2.0**60.0,
7
+ :peta => 2.0**50.0, :P => 2.0**50.0,
8
+ :tera => 2.0**40.0, :T => 2.0**40.0,
9
+ :giga => 2.0**30.0, :G => 2.0**30.0,
10
+ :mega => 2.0**20.0, :M => 2.0**20.0,
11
+ :kilo => 2.0**10.0, :k => 2.0**10.0,
12
+
13
+ # binary prefixes
14
+
15
+ :kibi => 2.0**10.0, :Ki => 2.0**10.0,
16
+ :mebi => 2.0**20.0, :Mi => 2.0**20.0,
17
+ :gibi => 2.0**30.0, :Gi => 2.0**30.0,
18
+ :tebi => 2.0**40.0, :Ti => 2.0**40.0,
19
+ :pebi => 2.0**50.0, :Pi => 2.0**50.0,
20
+ :exbi => 2.0**60.0, :Ei => 2.0**60.0,
21
+ :zebi => 2.0**70.0, :Zi => 2.0**70.0,
22
+ :yobi => 2.0**80.0, :Yi => 2.0**80.0
23
+ }
24
+ end
25
+ end
@@ -1,6 +1,7 @@
1
+ # TODO: remove all of this
1
2
  Alchemist.register_operation_conversions(:distance, :distance, :*, :square_meters)
2
3
  Alchemist.register_operation_conversions(:area, :distance, :*, :cubic_meters)
3
4
  Alchemist.register_operation_conversions(:distance, :area, :*, :cubic_meters)
4
5
  Alchemist.register_operation_conversions(:area, :distance, :/, :meters)
5
6
  Alchemist.register_operation_conversions(:volume, :distance, :/, :square_meters)
6
- Alchemist.register_operation_conversions(:volume, :area, :/, :meters)
7
+ Alchemist.register_operation_conversions(:volume, :area, :/, :meters)
@@ -0,0 +1,66 @@
1
+ module Alchemist
2
+ class CompoundNumericConversion
3
+ attr_accessor :numerators, :denominators
4
+
5
+ def initialize(numerator)
6
+ @coefficient = 1
7
+ @numerators = [numerator]
8
+ @denominators = []
9
+ end
10
+
11
+ def *(value)
12
+ case value
13
+ when Numeric
14
+ @coefficient *= value
15
+ self
16
+ when Alchemist::NumericConversion
17
+ @numerators << value
18
+ return consolidate
19
+ end
20
+ end
21
+
22
+ # TODO: minify this
23
+ def consolidate
24
+ compress_units
25
+ set_coefficients
26
+ end
27
+
28
+ def compress_units
29
+ @numerators.each_with_index do |numerator, n|
30
+ @denominators.each_with_index do |denominator, d|
31
+ remove_excess_units(numerator, n, denominator, d)
32
+ end
33
+ end
34
+ end
35
+
36
+ def remove_excess_units numerator, n, denominator, d
37
+ if should_remove_units? numerator, denominator
38
+ @numerators.delete_at(n)
39
+ @denominators.delete_at(d)
40
+ @coefficient *= (numerator / denominator)
41
+ end
42
+ end
43
+
44
+ def should_remove_units? numerator, denominator
45
+ return false if numerator.is_a?(Numeric) || denominator.is_a?(Numeric)
46
+ (Alchemist.measurement_for(numerator.unit_name) & Alchemist.measurement_for(denominator.unit_name)).length > 0
47
+ end
48
+
49
+ def set_coefficients
50
+ if @denominators.length == 0 && @numerators.length == 1
51
+ @numerators[0] * @coefficient
52
+ elsif @denominators.length == 0 && @numerators.length == 0
53
+ @coefficient
54
+ else
55
+ self
56
+ end
57
+ end
58
+
59
+ def method_missing(method, *attrs, &block)
60
+ if Alchemist.measurement_for(method)
61
+ @denominators << Alchemist.measurement(1, method)
62
+ consolidate
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,146 @@
1
+ module Alchemist
2
+ class NumericConversion
3
+ attr_reader :unit_name, :exponent, :value
4
+ include Comparable
5
+
6
+ def per
7
+ CompoundNumericConversion.new self
8
+ end
9
+ alias_method :p, :per # TODO: deprecate p
10
+
11
+ def to type = nil
12
+ unless type
13
+ self
14
+ else
15
+ send type
16
+ end
17
+ end
18
+ alias_method :as, :to # TODO: deprecate as
19
+
20
+ def base unit_type
21
+ conversion_base = conversion_base_for(unit_type)
22
+ convert_to_base conversion_base
23
+ end
24
+
25
+ def to_s
26
+ value.to_s
27
+ end
28
+
29
+ def to_i
30
+ value.to_i
31
+ end
32
+
33
+ def to_f
34
+ @value
35
+ end
36
+
37
+ def <=>(other)
38
+ (self.to_f * exponent).to_f <=> other.to(unit_name).to_f
39
+ end
40
+
41
+ private
42
+
43
+ def initialize value, unit_name, exponent = 1.0
44
+ @value = value.to_f
45
+ @unit_name = unit_name
46
+ @exponent = exponent
47
+ end
48
+
49
+ def convert_to_base conversion_base
50
+ if conversion_base.is_a?(Array)
51
+ exponent * conversion_base.first.call(value)
52
+ else
53
+ exponent * value * conversion_base
54
+ end
55
+ end
56
+
57
+ def conversion_base_for unit_type
58
+ Alchemist.conversion_table[unit_type][unit_name]
59
+ end
60
+
61
+ def convert_from_type type, unit_name, exponent
62
+ if(Alchemist.conversion_table[type][unit_name].is_a?(Array))
63
+ Alchemist.conversion_table[type][unit_name][1].call(base(type))
64
+ else
65
+ NumericConversion.new(base(type) / (exponent * Alchemist.conversion_table[type][unit_name]), unit_name)
66
+ end
67
+ end
68
+
69
+ def convert types, unit_name, exponent
70
+ if type = types[0]
71
+ convert_from_type type, unit_name, exponent
72
+ else
73
+ raise Exception, "Incompatible Types"
74
+ end
75
+ end
76
+
77
+ def multiply multiplicand
78
+ if multiplicand.is_a?(Numeric)
79
+ @value *= multiplicand
80
+ return self
81
+ else
82
+ raise Exception, "Incompatible Types"
83
+ end
84
+ end
85
+
86
+ def check_operator_conversion arg, unit_name
87
+ t1 = Alchemist.measurement_for(self.unit_name)[0]
88
+ t2 = Alchemist.measurement_for(arg.unit_name)[0]
89
+ Alchemist.operator_actions[unit_name].each do |s1, s2, new_type|
90
+ if t1 == s1 && t2 == s2
91
+ return ConversionWrap.new((value * arg.to_f).send(new_type))
92
+ end
93
+ end
94
+ end
95
+
96
+ def can_perform_conversion? arg, unit_name
97
+ arg.is_a?(NumericConversion) && Alchemist.operator_actions[unit_name]
98
+ end
99
+
100
+ def types
101
+ Alchemist.measurement_for(unit_name)
102
+ end
103
+
104
+ def shared_types other_unit_name
105
+ types & Alchemist.measurement_for(other_unit_name)
106
+ end
107
+
108
+ def has_shared_types? other_unit_name
109
+ shared_types(other_unit_name).length > 0
110
+ end
111
+
112
+ class ConversionWrap < Struct.new(:value)
113
+ end
114
+
115
+ def method_missing unit_name, *args, &block
116
+ exponent, unit_name = Alchemist.parse_prefix(unit_name)
117
+ arg = args.first
118
+
119
+ if Alchemist.measurement_for(unit_name)
120
+ convert shared_types(unit_name), unit_name, exponent
121
+ else
122
+ perform_conversion_method args, unit_name, exponent, &block
123
+ end
124
+ end
125
+
126
+ def perform_conversion_method args, unit_name, exponent, &block
127
+ arg = args.first
128
+ if can_perform_conversion?(arg, unit_name)
129
+ wrap = check_operator_conversion(arg, unit_name)
130
+ if wrap.is_a?(ConversionWrap)
131
+ return wrap.value
132
+ end
133
+ end
134
+ if unit_name == :*
135
+ return multiply(arg)
136
+ end
137
+ if unit_name == :/ && arg.is_a?(NumericConversion)
138
+ raise Exception, "Incompatible Types" unless has_shared_types?(arg.unit_name)
139
+ end
140
+ args.map!{|a| a.is_a?(NumericConversion) ? a.send(self.unit_name).to_f / exponent : a }
141
+ @value = value.send( unit_name, *args, &block )
142
+ unit_name == :/ ? value : self
143
+ end
144
+ end
145
+
146
+ end
@@ -0,0 +1,13 @@
1
+ module Alchemist
2
+ module Conversion
3
+ def method_missing unit_name, *args, &block
4
+ exponent, unit_name = Alchemist.parse_prefix(unit_name)
5
+ Alchemist.measurement_for(unit_name) || super( unit_name, *args, &block )
6
+ Alchemist.measurement self, unit_name, exponent
7
+ end
8
+ end
9
+ end
10
+
11
+ class Numeric
12
+ include Alchemist::Conversion
13
+ end
@@ -0,0 +1,13 @@
1
+ module Alchemist
2
+ def self.si_units
3
+ %w[
4
+ m meter metre meters metres liter litre litres liters l L
5
+ farad farads F coulombs C gray grays Gy siemen siemens S
6
+ mhos mho ohm ohms volt volts V joule joules J newton
7
+ newtons N lux lx henry henrys H b B bits bytes bit byte
8
+ lumen lumens lm candela candelas cd tesla teslas T gauss
9
+ Gs G gram gramme grams grammes g watt watts W pascal
10
+ pascals Pa becquerel becquerels Bq curie curies Ci
11
+ ]
12
+ end
13
+ end
@@ -0,0 +1,38 @@
1
+ module Alchemist
2
+ def self.unit_prefixes
3
+ {
4
+ :googol => 1e+100,
5
+ :yotta => 1e+24, :Y => 1e+24,
6
+ :zetta => 1e+21, :Z => 1e+21,
7
+ :exa => 1e+18, :E => 1e+18,
8
+ :peta => 1e+15, :P => 1e+15,
9
+ :tera => 1e+12, :T => 1e+12,
10
+ :giga => 1e+9, :G => 1e+9,
11
+ :mega => 1e+6, :M => 1e+6,
12
+ :kilo => 1e+3, :k => 1e+3,
13
+ :hecto => 1e+2, :h => 1e+2,
14
+ :deca => 10, :da => 10,
15
+ :deci => 1e-1, :d => 1e-1,
16
+ :centi => 1e-2, :c => 1e-2,
17
+ :milli => 1e-3, :m => 1e-3,
18
+ :micro => 1e-6, :u => 1e-6,
19
+ :nano => 1e-9, :n => 1e-9,
20
+ :pico => 1e-12, :p => 1e-12,
21
+ :femto => 1e-15, :f => 1e-15,
22
+ :atto => 1e-18, :a => 1e-18,
23
+ :zepto => 1e-21, :z => 1e-21,
24
+ :yocto => 1e-24, :y => 1e-24,
25
+
26
+ # binary prefixes
27
+
28
+ :kibi => 2.0**10.0, :Ki => 2.0**10.0,
29
+ :mebi => 2.0**20.0, :Mi => 2.0**20.0,
30
+ :gibi => 2.0**30.0, :Gi => 2.0**30.0,
31
+ :tebi => 2.0**40.0, :Ti => 2.0**40.0,
32
+ :pebi => 2.0**50.0, :Pi => 2.0**50.0,
33
+ :exbi => 2.0**60.0, :Ei => 2.0**60.0,
34
+ :zebi => 2.0**70.0, :Zi => 2.0**70.0,
35
+ :yobi => 2.0**80.0, :Yi => 2.0**80.0
36
+ }
37
+ end
38
+ end
@@ -0,0 +1,76 @@
1
+ require 'yaml'
2
+ require 'alchemist/si_units'
3
+ require 'alchemist/unit_prefixes'
4
+ require 'alchemist/binary_prefixes'
5
+
6
+ module Alchemist
7
+ class ConversionTable
8
+
9
+ def load_all
10
+ @conversions ||= load_yaml.merge(proc_based)
11
+ end
12
+
13
+ private
14
+
15
+ def load_yaml
16
+ YAML.load_file(yaml_file)
17
+ end
18
+
19
+ def yaml_file
20
+ File.join(File.dirname(__FILE__), "units.yml")
21
+ end
22
+
23
+ def proc_based
24
+ {
25
+ :density => {
26
+ :specific_gravity => 1, :sg => 1,
27
+ :brix => [lambda{ |d| -261.3 / (d - 261.3) }, lambda{ |d| 261.3 - (261.3 / d) }],
28
+ :plato => [lambda{ |d| -260.0 / (d - 260.0) }, lambda{ |d| 260.0 - (260.0 / d) }],
29
+ :baume => [lambda{ |d| -145.0 / (d - 145.0) }, lambda{ |d| 145.0 - (145.0 / d) }]
30
+ },
31
+ :temperature => temperature
32
+ }
33
+ end
34
+
35
+ def temperature
36
+ {
37
+ :kelvin => 1.0, :K => 1.0,
38
+
39
+ :celsius => celsius_conversion,
40
+ :centrigrade => celsius_conversion,
41
+ :degree_celsius => celsius_conversion,
42
+ :degree_centrigrade => celsius_conversion,
43
+ :degrees_celsius => celsius_conversion,
44
+ :degrees_centrigrade => celsius_conversion,
45
+ :fahrenheit => fahrenheit_conversion,
46
+ :degree_fahrenheit => fahrenheit_conversion,
47
+ :degrees_fahrenheit => fahrenheit_conversion,
48
+ :rankine => 1.8, :rankines => 1.8
49
+ }
50
+ end
51
+
52
+ def to_celsius
53
+ lambda{ |t| t + 273.15 }
54
+ end
55
+
56
+ def from_celsius
57
+ lambda{ |t| t - 273.15 }
58
+ end
59
+
60
+ def celsius_conversion
61
+ [to_celsius, from_celsius]
62
+ end
63
+
64
+ def to_fahrenheit
65
+ lambda{ |t| (t + 459.67) * (5.0/9.0) }
66
+ end
67
+
68
+ def from_fahrenheit
69
+ lambda{ |t| t * (9.0/5.0) - 459.67 }
70
+ end
71
+
72
+ def fahrenheit_conversion
73
+ [to_fahrenheit, from_fahrenheit]
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,559 @@
1
+ ---
2
+ :absorbed_radiation_dose:
3
+ :gray: 1.0
4
+ :grays: 1.0
5
+ :Gy: 1.0
6
+ :rad: 0.01
7
+ :rads: 0.01
8
+ :angles:
9
+ :radian: 1.0
10
+ :radians: 1.0
11
+ :degree: 0.017453292519943295
12
+ :degrees: 0.017453292519943295
13
+ :arcminute: 0.0002908882086657216
14
+ :arcminutes: 0.0002908882086657216
15
+ :arcsecond: 4.84813681109536e-06
16
+ :arcseconds: 4.84813681109536e-06
17
+ :mil: 0.0009817477
18
+ :mils: 0.0009817477
19
+ :revolution: 6.283185307179586
20
+ :revolutions: 6.283185307179586
21
+ :circle: 6.283185307179586
22
+ :circles: 6.283185307179586
23
+ :right_angle: 1.5707963267948966
24
+ :right_angles: 1.5707963267948966
25
+ :grad: 0.015707963267948967
26
+ :grade: 0.015707963267948967
27
+ :gradian: 0.015707963267948967
28
+ :gon: 0.015707963267948967
29
+ :grads: 0.015707963267948967
30
+ :grades: 0.015707963267948967
31
+ :gradians: 0.015707963267948967
32
+ :gons: 0.015707963267948967
33
+ :furman: 9.58737992858887e-05
34
+ :furmans: 9.58737992858887e-05
35
+ :area:
36
+ :square_meter: 1.0
37
+ :square_meters: 1.0
38
+ :square_metre: 1.0
39
+ :square_metres: 1.0
40
+ :acre: 4046.85642
41
+ :acres: 4046.85642
42
+ :are: 100.0
43
+ :ares: 100.0
44
+ :a: 100.0
45
+ :barn: 1.0e-28
46
+ :barns: 1.0e-28
47
+ :b: 1.0e-28
48
+ :circular_mil: 5.067075e-10
49
+ :circular_mils: 5.067075e-10
50
+ :hectare: 10000.0
51
+ :hectares: 10000.0
52
+ :ha: 10000.0
53
+ :square_foot: 0.09290304
54
+ :square_feet: 0.09290304
55
+ :square_inch: 0.00064516
56
+ :square_inches: 0.00064516
57
+ :square_mile: 2589988.0
58
+ :square_miles: 2589988.0
59
+ :square_yard: 0.83612736
60
+ :square_yards: 0.83612736
61
+ :capacitance:
62
+ :farad: 1.0
63
+ :farads: 1.0
64
+ :F: 1.0
65
+ :abfarad: 1000000000.0
66
+ :emu_of_capacitance: 1000000000.0
67
+ :abfarads: 1000000000.0
68
+ :emus_of_capacitance: 1000000000.0
69
+ :statfarad: 1.11265e-12
70
+ :esu_of_capacitance: 1.11265e-12
71
+ :statfarads: 1.11265e-12
72
+ :esus_of_capacitance: 1.11265e-12
73
+ :distance:
74
+ :meter: 1.0
75
+ :metres: 1.0
76
+ :meters: 1.0
77
+ :m: 1.0
78
+ :fermi: 1.0e-15
79
+ :fermis: 1.0e-15
80
+ :micron: 1.0e-06
81
+ :microns: 1.0e-06
82
+ :chain: 20.1168
83
+ :chains: 20.1168
84
+ :inch: 0.0254
85
+ :inches: 0.0254
86
+ :in: 0.0254
87
+ :microinch: 2.54e-08
88
+ :microinches: 2.54e-08
89
+ :mil: 2.54e-05
90
+ :mils: 2.54e-05
91
+ :rod: 5.02921
92
+ :rods: 5.02921
93
+ :league: 5556
94
+ :leagues: 5556
95
+ :foot: 0.3048
96
+ :feet: 0.3048
97
+ :ft: 0.3048
98
+ :yard: 0.9144
99
+ :yards: 0.9144
100
+ :yd: 0.9144
101
+ :mile: 1609.344
102
+ :miles: 1609.344
103
+ :mi: 1609.344
104
+ :astronomical_unit: 149600000000.0
105
+ :astronomical_units: 149600000000.0
106
+ :au: 149600000000.0
107
+ :ua: 149600000000.0
108
+ :light_year: 9461000000000000.0
109
+ :light_years: 9461000000000000.0
110
+ :ly: 9461000000000000.0
111
+ :parsec: 30857000000000000.0
112
+ :parsecs: 30857000000000000.0
113
+ :nautical_mile: 1852.0
114
+ :nautical_miles: 1852.0
115
+ :admirality_mile: 185.3184
116
+ :admirality_miles: 185.3184
117
+ :fathom: 1.8288
118
+ :fathoms: 1.8288
119
+ :cable_length: 185.2
120
+ :cable_lengths: 185.2
121
+ :angstrom: 1.0e-10
122
+ :angstroms: 1.0e-10
123
+ :pica: 0.004233333
124
+ :picas: 0.004233333
125
+ :printer_pica: 0.004217518
126
+ :printer_picas: 0.004217518
127
+ :point: 0.0003527778
128
+ :points: 0.0003527778
129
+ :printer_point: 0.0003514598
130
+ :printer_points: 0.0003514598
131
+ :empire_state_building: 449.0
132
+ :empire_state_buildings: 449.0
133
+ :sears_tower: 519.0
134
+ :sears_towers: 519.0
135
+ :seattle_space_needle: 184.0
136
+ :seattle_space_needles: 184.0
137
+ :space_needle: 184.0
138
+ :space_needles: 184.0
139
+ :statue_of_liberty: 46.0
140
+ :statue_of_liberties: 46.0
141
+ :washington_monument: 169.294
142
+ :washington_monuments: 169.294
143
+ :eiffel_tower: 324.0
144
+ :eiffel_towers: 324.0
145
+ :nelsons_column: 61.5
146
+ :nelsons_columns: 61.5
147
+ :blackpool_tower: 158.0
148
+ :blackpool_towers: 158.0
149
+ :big_ben: 96.3
150
+ :big_bens: 96.3
151
+ :clock_tower_of_the_palace_of_westminster: 96.3
152
+ :clock_towers_of_the_palace_of_westminster: 96.3
153
+ :st_pauls_cathedral: 108.0
154
+ :st_pauls_cathedrals: 108.0
155
+ :toronto_cn_tower: 553.0
156
+ :toronto_cn_towers: 553.0
157
+ :cn_tower: 553.0
158
+ :cn_towers: 553.0
159
+ :circle_of_the_earth: 40075016.686
160
+ :equator: 40075016.686
161
+ :circles_of_the_earth: 40075016.686
162
+ :equators: 40075016.686
163
+ :siriometer: 149483800000000000.0
164
+ :siriometers: 149483800000000000.0
165
+ :football_field: 91.0
166
+ :football_fields: 91.0
167
+ :length_of_a_double_decker_bus: 8.4
168
+ :height_of_a_double_decker_bus: 4.4
169
+ :smoot: 1.7018
170
+ :smoots: 1.7018
171
+ :dose_equivalent:
172
+ :sievert: 1.0
173
+ :sieverts: 1.0
174
+ :Si: 1.0
175
+ :rem: 0.01
176
+ :rems: 0.01
177
+ :electric_charge:
178
+ :coulomb: 1.0
179
+ :coulombs: 1.0
180
+ :C: 1.0
181
+ :abcoulomb: 10.0
182
+ :abcoulombs: 10.0
183
+ :ampere_hour: 3600.0
184
+ :ampere_hours: 3600.0
185
+ :faraday: 96485.34
186
+ :faradays: 96485.34
187
+ :franklin: 3.335641e-10
188
+ :franklins: 3.335641e-10
189
+ :Fr: 3.335641e-10
190
+ :statcoulomb: 3.335641e-10
191
+ :statcoulombs: 3.335641e-10
192
+ :electric_conductance:
193
+ :siemen: 1.0
194
+ :siemens: 1.0
195
+ :S: 1.0
196
+ :mho: 1.0
197
+ :abmho: 1000000000.0
198
+ :absiemen: 1000000000.0
199
+ :absiemens: 1000000000.0
200
+ :statmho: 1.11265e-12
201
+ :statsiemen: 1.11265e-12
202
+ :statsiemens: 1.11265e-12
203
+ :electrical_impedance:
204
+ :ohm: 1.0
205
+ :ohms: 1.0
206
+ :abohm: 1.0e-09
207
+ :emu_of_resistance: 1.0e-09
208
+ :abohms: 1.0e-09
209
+ :emus_of_resistance: 1.0e-09
210
+ :statohm: 898755200000.0
211
+ :esu_of_resistance: 898755200000.0
212
+ :statohms: 898755200000.0
213
+ :esus_of_resistance: 898755200000.0
214
+ :electromotive_force:
215
+ :volt: 1.0
216
+ :volts: 1.0
217
+ :V: 1.0
218
+ :abvolt: 1.0e-08
219
+ :emu_of_electric_potential: 1.0e-08
220
+ :abvolts: 1.0e-08
221
+ :emus_of_electric_potential: 1.0e-08
222
+ :statvolt: 299.7925
223
+ :esu_of_electric_potential: 299.7925
224
+ :statvolts: 299.7925
225
+ :esus_of_electric_potential: 299.7925
226
+ :energy:
227
+ :joule: 1.0
228
+ :joules: 1.0
229
+ :J: 1.0
230
+ :watt_second: 1.0
231
+ :watt_seconds: 1.0
232
+ :watt_hour: 3600.0
233
+ :watt_hours: 3600.0
234
+ :ton_of_tnt: 4184000000.0
235
+ :tons_of_tnt: 4184000000.0
236
+ :therm: 105506000.0
237
+ :therms: 105506000.0
238
+ :us_therm: 105480400.0
239
+ :us_therms: 105480400.0
240
+ :kilowatt_hour: 3600000.0
241
+ :kilowatt_hours: 3600000.0
242
+ :kilocalorie: 4184.0
243
+ :kilocalories: 4184.0
244
+ :calorie: 4.184
245
+ :calories: 4.184
246
+ :mean_kilocalorie: 4190
247
+ :mean_kilocalories: 4190
248
+ :mean_calorie: 4.19
249
+ :mean_calories: 4.19
250
+ :it_kilocalorie: 4186.8
251
+ :it_kilocalories: 4186.8
252
+ :it_calorie: 4.1868
253
+ :it_calories: 4.1868
254
+ :foot_poundal: 0.04214011
255
+ :foot_poundals: 0.04214011
256
+ :foot_pound_force: 1.355818
257
+ :erg: 1.0e-07
258
+ :ergs: 1.0e-07
259
+ :electronvolt: 1.602176e-19
260
+ :electronvolts: 1.602176e-19
261
+ :eV: 1.602176e-19
262
+ :british_thermal_unit: 1054.35
263
+ :british_thermal_units: 1054.35
264
+ :mean_british_thermal_unit: 1055.87
265
+ :mean_british_thermal_units: 1055.87
266
+ :it_british_thermal_unit: 1055.056
267
+ :it_british_thermal_units: 1055.056
268
+ :foe: 1.0e+44
269
+ :foes: 1.0e+44
270
+ :frequency:
271
+ :hertz: 1.0
272
+ :hz: 1.0
273
+ :Hz: 1.0
274
+ :revolutions_per_minute: 0.016666666666666666
275
+ :rpm: 0.016666666666666666
276
+ :beats_per_minute: 0.016666666666666666
277
+ :bpm: 0.016666666666666666
278
+ :force:
279
+ :newton: 1.0
280
+ :newtons: 1.0
281
+ :N: 1.0
282
+ :dyne: 1.0e-05
283
+ :dynes: 1.0e-05
284
+ :dyn: 1.0e-05
285
+ :kilogram_force: 9.80665
286
+ :kgf: 9.80665
287
+ :kilopond: 9.80665
288
+ :kiloponds: 9.80665
289
+ :kp: 9.80665
290
+ :kip: 4448.222
291
+ :kips: 4448.222
292
+ :ounce_force: 0.2780139
293
+ :ozf: 0.2780139
294
+ :poundal: 0.138255
295
+ :poundals: 0.138255
296
+ :pound_force: 4.448222
297
+ :lbf: 4.448222
298
+ :ton_force: 8896.443
299
+ :illuminance:
300
+ :lux: 1.0
301
+ :lx: 1.0
302
+ :lumens_per_square_metre: 1.0
303
+ :lumens_per_square_meter: 1.0
304
+ :lumen_per_square_metre: 1.0
305
+ :lumen_per_square_meter: 1.0
306
+ :phot: 10000.0
307
+ :phots: 10000.0
308
+ :ph: 10000.0
309
+ :lumens_per_square_foot: 10.76391
310
+ :footcandle: 10.76391
311
+ :lumen_per_square_foot: 10.76391
312
+ :footcandles: 10.76391
313
+ :inductance:
314
+ :henry: 1.0
315
+ :henrys: 1.0
316
+ :H: 1.0
317
+ :abhenrys: 1.0e-09
318
+ :emus_of_inductance: 1.0e-09
319
+ :abhenry: 1.0e-09
320
+ :emu_of_inductance: 1.0e-09
321
+ :stathenrys: 898755200000.0
322
+ :esus_of_inductance: 898755200000.0
323
+ :stathenry: 898755200000.0
324
+ :esu_of_inductance: 898755200000.0
325
+ :information_storage:
326
+ :bit: 1.0
327
+ :bits: 1.0
328
+ :b: 1.0
329
+ :byte: 8.0
330
+ :bytes: 8.0
331
+ :B: 8.0
332
+ :nibbles: 4.0
333
+ :nybbles: 4.0
334
+ :luminous_flux:
335
+ :lumen: 1.0
336
+ :lumens: 1.0
337
+ :lm: 1.0
338
+ :luminous_intensity:
339
+ :candela: 1.0
340
+ :candelas: 1.0
341
+ :cd: 1.0
342
+ :magnetic_flux:
343
+ :webers: 1.0
344
+ :Wb: 1.0
345
+ :maxwells: 1.0e-08
346
+ :Mx: 1.0e-08
347
+ :unit_poles: 1.256637e-07
348
+ :magnetic_inductance:
349
+ :tesla: 1.0
350
+ :teslas: 1.0
351
+ :T: 1.0
352
+ :gamma: 1.0e-09
353
+ :gammas: 1.0e-09
354
+ :gauss: 0.0001
355
+ :Gs: 0.0001
356
+ :G: 0.0001
357
+ :mass:
358
+ :gram: 1.0
359
+ :gramme: 1.0
360
+ :grams: 1.0
361
+ :grammes: 1.0
362
+ :g: 1.0
363
+ :carat: 0.2
364
+ :carats: 0.2
365
+ :ounce: 28.34952
366
+ :ounces: 28.34952
367
+ :oz: 28.34952
368
+ :pennyweight: 1.555174
369
+ :pennyweights: 1.555174
370
+ :dwt: 1.555174
371
+ :pound: 453.59237
372
+ :pounds: 453.59237
373
+ :lb: 453.59237
374
+ :lbs: 453.59237
375
+ :troy_pound: 373.2417
376
+ :apothecary_pound: 373.2417
377
+ :troy_pounds: 373.2417
378
+ :apothecary_pounds: 373.2417
379
+ :slug: 14593.9029
380
+ :slugs: 14593.9029
381
+ :assay_ton: 29.1667
382
+ :assay_tons: 29.1667
383
+ :AT: 29.1667
384
+ :metric_ton: 1000000
385
+ :metric_tons: 1000000
386
+ :ton: 907184.74
387
+ :tons: 907184.74
388
+ :short_tons: 907184.74
389
+ :elephant: 5443108.44
390
+ :elephants: 5443108.44
391
+ :power:
392
+ :watt: 1.0
393
+ :watts: 1.0
394
+ :W: 1.0
395
+ :british_thermal_unit_per_hour: 0.2928751
396
+ :british_thermal_units_per_hour: 0.2928751
397
+ :it_british_thermal_unit_per_hour: 0.2930711
398
+ :it_british_thermal_units_per_hour: 0.2930711
399
+ :british_thermal_unit_per_second: 1054.35
400
+ :british_thermal_units_per_second: 1054.35
401
+ :it_british_thermal_unit_per_second: 1055.056
402
+ :it_british_thermal_units_per_second: 1055.056
403
+ :calorie_per_minute: 0.06973333
404
+ :calories_per_minute: 0.06973333
405
+ :calorie_per_second: 4.184
406
+ :calories_per_second: 4.184
407
+ :erg_per_second: 1.0e-07
408
+ :ergs_per_second: 1.0e-07
409
+ :foot_pound_force_per_hour: 0.0003766161
410
+ :foot_pound_force_per_minute: 0.02259697
411
+ :foot_pound_force_per_second: 1.355818
412
+ :horsepower: 745.6999
413
+ :boiler_horsepower: 9809.5
414
+ :electric_horsepower: 746.0
415
+ :metric_horsepower: 735.4988
416
+ :uk_horsepower: 745.7
417
+ :water_horsepower: 746.043
418
+ :kilocalorie_per_minute: 69.73333
419
+ :kilocalories_per_minute: 69.73333
420
+ :kilocalorie_per_second: 4184.0
421
+ :kilocalories_per_second: 4184.0
422
+ :ton_of_refrigeration: 3516.853
423
+ :tons_of_refrigeration: 3516.853
424
+ :pressure:
425
+ :pascal: 1.0
426
+ :pascals: 1.0
427
+ :Pa: 1.0
428
+ :atmosphere: 101325.0
429
+ :atmospheres: 101325.0
430
+ :technical_atmosphere: 98066.5
431
+ :technical_atmospheres: 98066.5
432
+ :bar: 100000.0
433
+ :bars: 100000.0
434
+ :centimeter_of_mercury: 1333.224
435
+ :centimeters_of_mercury: 1333.224
436
+ :centimeter_of_water: 98.0665
437
+ :centimeters_of_water: 98.0665
438
+ :gram_force_per_square_centimeter: 98.0665
439
+ :dyne_per_square_centimeter: 0.1
440
+ :dynes_per_square_centimeter: 0.1
441
+ :foot_of_mercury: 40636.66
442
+ :feet_of_mercury: 40636.66
443
+ :foot_of_water: 2989.067
444
+ :feet_of_water: 2989.067
445
+ :inch_of_mercury: 3386.389
446
+ :inches_of_mercury: 3386.389
447
+ :inch_of_water: 249.0889
448
+ :inches_of_water: 249.0889
449
+ :kilogram_force_per_square_centimeter: 98066.5
450
+ :kilogram_force_per_square_meter: 9.80665
451
+ :kilogram_force_per_square_millimeter: 9806650.0
452
+ :kip_per_square_inch: 6894757.0
453
+ :kips_per_square_inch: 6894757.0
454
+ :ksi: 6894757.0
455
+ :millibar: 100.0
456
+ :mbar: 100.0
457
+ :millibars: 100.0
458
+ :mbars: 100.0
459
+ :millimeter_of_mercury: 133.3224
460
+ :millimeters_of_mercury: 133.3224
461
+ :millimeter_of_water: 9.80665
462
+ :millimeters_of_water: 9.80665
463
+ :poundal_per_square_foot: 1.488164
464
+ :poundals_per_square_foot: 1.488164
465
+ :pound_force_per_square_foot: 47.88026
466
+ :pound_force_per_square_inch: 6894.757
467
+ :psi: 6894.757
468
+ :torr: 133.3224
469
+ :torrs: 133.3224
470
+ :radioactivity:
471
+ :becquerel: 1.0
472
+ :becquerels: 1.0
473
+ :Bq: 1.0
474
+ :curie: 37000000000.0
475
+ :curies: 37000000000.0
476
+ :Ci: 37000000000.0
477
+ :time:
478
+ :second: 1.0
479
+ :seconds: 1.0
480
+ :s: 1.0
481
+ :minute: 60.0
482
+ :minutes: 60.0
483
+ :min: 60.0
484
+ :sidereal_minute: 5.983617
485
+ :sidereal_minutes: 5.983617
486
+ :hour: 3600.0
487
+ :hours: 3600.0
488
+ :hr: 3600.0
489
+ :h: 3600.0
490
+ :sidereal_hour: 3590.17
491
+ :sidereal_hours: 3590.17
492
+ :day: 86400.0
493
+ :days: 86400.0
494
+ :sidereal_day: 86164.09
495
+ :sidereal_days: 86164.09
496
+ :shake: 1.0e-08
497
+ :shakes: 1.0e-08
498
+ :year: 31536000.0
499
+ :years: 31536000.0
500
+ :sidereal_year: 31558150.0
501
+ :sidereal_years: 31558150.0
502
+ :tropical_year: 31556930.0
503
+ :tropical_years: 31556930.0
504
+ :jiffy: 0.01
505
+ :jiffies: 0.01
506
+ :microfortnight: 1.2096
507
+ :microfortnights: 1.2096
508
+ :megaannum: 31536000000000000.0
509
+ :Ma: 31536000000000000.0
510
+ :megaannums: 31536000000000000.0
511
+ :galactic_year: 7884000000000000000.0
512
+ :galactic_years: 7884000000000000000.0
513
+ :GY: 7884000000000000000.0
514
+ :volume:
515
+ :litre: 1.0
516
+ :liter: 1.0
517
+ :litres: 1.0
518
+ :liters: 1.0
519
+ :l: 1.0
520
+ :L: 1.0
521
+ :barrel: 158.9873
522
+ :barrels: 158.9873
523
+ :bushel: 35.23907
524
+ :bushels: 35.23907
525
+ :cubic_meter: 1000.0
526
+ :cubic_meters: 1000.0
527
+ :cup: 0.2365882
528
+ :cups: 0.2365882
529
+ :imperial_fluid_ounce: 0.0284130742
530
+ :imperial_fluid_ounces: 0.0284130742
531
+ :ounce: 0.0295735296
532
+ :ounces: 0.0295735296
533
+ :fluid_ounce: 0.0295735296
534
+ :fluid_ounces: 0.0295735296
535
+ :imperial_gallon: 4.54609
536
+ :imperial_gallons: 4.54609
537
+ :gallon: 3.785412
538
+ :gallons: 3.785412
539
+ :gals: 3.785412
540
+ :Gals: 3.785412
541
+ :imperial_gill: 0.1420653
542
+ :imperial_gills: 0.1420653
543
+ :gill: 0.1182941
544
+ :gills: 0.1182941
545
+ :gi: 0.1182941
546
+ :pint: 0.5506105
547
+ :pints: 0.5506105
548
+ :liquid_pint: 0.4731765
549
+ :liquid_pints: 0.4731765
550
+ :quart: 1.101221
551
+ :quarts: 1.101221
552
+ :liquid_quart: 0.9463529
553
+ :liquid_quarts: 0.9463529
554
+ :tablespoon: 0.0147867648
555
+ :tablespoons: 0.0147867648
556
+ :teaspoon: 0.00492892159
557
+ :teaspoons: 0.00492892159
558
+ :sydharb: 500000000000.0
559
+ :sydharbs: 500000000000.0