unit_conversions/
energy.rs

1// <auto-generated>
2// This code was generated by the UnitCodeGenerator tool
3//
4// Changes to this file will be lost if the code is regenerated
5// </auto-generated>
6
7//! # Energy based converters
8
9/// Btu conversion functions
10pub mod btu {
11	/// Converts the supplied Btu value to Kilojoules
12	/// # Arguments
13	/// * `value` - The Btu input value
14	pub fn to_kilojoules(value: f64) -> f64 {
15		return value * 1.0550559;
16	}
17	/// Converts the supplied Btu value to Kilocalories
18	/// # Arguments
19	/// * `value` - The Btu input value
20	pub fn to_kilocalories(value: f64) -> f64 {
21		return value * 0.2521644007218;
22	}
23	/// Converts the supplied Btu value to Joules
24	/// # Arguments
25	/// * `value` - The Btu input value
26	pub fn to_joules(value: f64) -> f64 {
27		return value * 1055.06;
28	}
29	/// Converts the supplied Btu value to Calories
30	/// # Arguments
31	/// * `value` - The Btu input value
32	pub fn to_calories(value: f64) -> f64 {
33		return value * 252.1644007218;
34	}
35	/// Converts the supplied Btu value to US Therms
36	/// # Arguments
37	/// * `value` - The Btu input value
38	pub fn to_u_s_therms(value: f64) -> f64 {
39		return value / 99976.12448781215;
40	}
41	/// Converts the supplied Btu value to Watt Hours
42	/// # Arguments
43	/// * `value` - The Btu input value
44	pub fn to_watt_hours(value: f64) -> f64 {
45		return value * 0.293071;
46	}
47	/// Converts the supplied Btu value to Kilowatt Hours
48	/// # Arguments
49	/// * `value` - The Btu input value
50	pub fn to_kilowatt_hours(value: f64) -> f64 {
51		return value / 3412.14;
52	}
53	/// Converts the supplied Btu value to Foot Pounds
54	/// # Arguments
55	/// * `value` - The Btu input value
56	pub fn to_foot_pounds(value: f64) -> f64 {
57		return value * 778.169;
58	}
59	/// Converts the supplied Btu value to Electronvolts
60	/// # Arguments
61	/// * `value` - The Btu input value
62	pub fn to_electronvolts(value: f64) -> f64 {
63		return value * 6585141385224143241216.00;
64	}
65}
66/// Calories conversion functions
67pub mod calories {
68	/// Converts the supplied Calories value to Kilojoules
69	/// # Arguments
70	/// * `value` - The Calories input value
71	pub fn to_kilojoules(value: f64) -> f64 {
72		return value / 239.0057;
73	}
74	/// Converts the supplied Calories value to Kilocalories
75	/// # Arguments
76	/// * `value` - The Calories input value
77	pub fn to_kilocalories(value: f64) -> f64 {
78		return value / 1000.0;
79	}
80	/// Converts the supplied Calories value to Joules
81	/// # Arguments
82	/// * `value` - The Calories input value
83	pub fn to_joules(value: f64) -> f64 {
84		return value * 4.184;
85	}
86	/// Converts the supplied Calories value to Btu
87	/// # Arguments
88	/// * `value` - The Calories input value
89	pub fn to_btu(value: f64) -> f64 {
90		return value / 252.1644007218;
91	}
92	/// Converts the supplied Calories value to US Therms
93	/// # Arguments
94	/// * `value` - The Calories input value
95	pub fn to_u_s_therms(value: f64) -> f64 {
96		return value / 25210420.0;
97	}
98	/// Converts the supplied Calories value to Watt Hours
99	/// # Arguments
100	/// * `value` - The Calories input value
101	pub fn to_watt_hours(value: f64) -> f64 {
102		return value * 0.00116222;
103	}
104	/// Converts the supplied Calories value to Kilowatt Hours
105	/// # Arguments
106	/// * `value` - The Calories input value
107	pub fn to_kilowatt_hours(value: f64) -> f64 {
108		return value / 860421.0;
109	}
110	/// Converts the supplied Calories value to Foot Pounds
111	/// # Arguments
112	/// * `value` - The Calories input value
113	pub fn to_foot_pounds(value: f64) -> f64 {
114		return value * 3.08596;
115	}
116	/// Converts the supplied Calories value to Electronvolts
117	/// # Arguments
118	/// * `value` - The Calories input value
119	pub fn to_electronvolts(value: f64) -> f64 {
120		return value * 2.6131936951817e+19;
121	}
122}
123/// Electronvolts conversion functions
124pub mod electronvolts {
125	/// Converts the supplied Electronvolts value to Kilojoules
126	/// # Arguments
127	/// * `value` - The Electronvolts input value
128	pub fn to_kilojoules(value: f64) -> f64 {
129		return value / 6241509744511500156928.00;
130	}
131	/// Converts the supplied Electronvolts value to Kilocalories
132	/// # Arguments
133	/// * `value` - The Electronvolts input value
134	pub fn to_kilocalories(value: f64) -> f64 {
135		return value / 26131952998320305078272.00;
136	}
137	/// Converts the supplied Electronvolts value to Joules
138	/// # Arguments
139	/// * `value` - The Electronvolts input value
140	pub fn to_joules(value: f64) -> f64 {
141		return value / 6241509343300000000.0;
142	}
143	/// Converts the supplied Electronvolts value to Btu
144	/// # Arguments
145	/// * `value` - The Electronvolts input value
146	pub fn to_btu(value: f64) -> f64 {
147		return value / 6585141385224143241216.0;
148	}
149	/// Converts the supplied Electronvolts value to Calories
150	/// # Arguments
151	/// * `value` - The Electronvolts input value
152	pub fn to_calories(value: f64) -> f64 {
153		return value / 2.6131936951817e+19;
154	}
155	/// Converts the supplied Electronvolts value to US Therms
156	/// # Arguments
157	/// * `value` - The Electronvolts input value
158	pub fn to_u_s_therms(value: f64) -> f64 {
159		return value / 6.5835660010911e+26;
160	}
161	/// Converts the supplied Electronvolts value to Watt Hours
162	/// # Arguments
163	/// * `value` - The Electronvolts input value
164	pub fn to_watt_hours(value: f64) -> f64 {
165		return value / 2.2469422907138e+22;
166	}
167	/// Converts the supplied Electronvolts value to Kilowatt Hours
168	/// # Arguments
169	/// * `value` - The Electronvolts input value
170	pub fn to_kilowatt_hours(value: f64) -> f64 {
171		return value / 2.246943e+25;
172	}
173	/// Converts the supplied Electronvolts value to Foot Pounds
174	/// # Arguments
175	/// * `value` - The Electronvolts input value
176	pub fn to_foot_pounds(value: f64) -> f64 {
177		return value / 8462350936293971968.00;
178	}
179}
180/// Foot Pounds conversion functions
181pub mod foot_pounds {
182	/// Converts the supplied Foot Pounds value to Kilojoules
183	/// # Arguments
184	/// * `value` - The Foot Pounds input value
185	pub fn to_kilojoules(value: f64) -> f64 {
186		return value / 737.562;
187	}
188	/// Converts the supplied Foot Pounds value to Kilocalories
189	/// # Arguments
190	/// * `value` - The Foot Pounds input value
191	pub fn to_kilocalories(value: f64) -> f64 {
192		return value / 3085.96;
193	}
194	/// Converts the supplied Foot Pounds value to Joules
195	/// # Arguments
196	/// * `value` - The Foot Pounds input value
197	pub fn to_joules(value: f64) -> f64 {
198		return value * 1.35582;
199	}
200	/// Converts the supplied Foot Pounds value to Btu
201	/// # Arguments
202	/// * `value` - The Foot Pounds input value
203	pub fn to_btu(value: f64) -> f64 {
204		return value / 778.169;
205	}
206	/// Converts the supplied Foot Pounds value to Calories
207	/// # Arguments
208	/// * `value` - The Foot Pounds input value
209	pub fn to_calories(value: f64) -> f64 {
210		return value / 3.08596;
211	}
212	/// Converts the supplied Foot Pounds value to US Therms
213	/// # Arguments
214	/// * `value` - The Foot Pounds input value
215	pub fn to_u_s_therms(value: f64) -> f64 {
216		return value / 77816937.099186;
217	}
218	/// Converts the supplied Foot Pounds value to Watt Hours
219	/// # Arguments
220	/// * `value` - The Foot Pounds input value
221	pub fn to_watt_hours(value: f64) -> f64 {
222		return value / 2655.22;
223	}
224	/// Converts the supplied Foot Pounds value to Kilowatt Hours
225	/// # Arguments
226	/// * `value` - The Foot Pounds input value
227	pub fn to_kilowatt_hours(value: f64) -> f64 {
228		return value * 0.00000037662;
229	}
230	/// Converts the supplied Foot Pounds value to Electronvolts
231	/// # Arguments
232	/// * `value` - The Foot Pounds input value
233	pub fn to_electronvolts(value: f64) -> f64 {
234		return value * 8462350936293971968.00;
235	}
236}
237/// Joules conversion functions
238pub mod joules {
239	/// Converts the supplied Joules value to Kilojoules
240	/// # Arguments
241	/// * `value` - The Joules input value
242	pub fn to_kilojoules(value: f64) -> f64 {
243		return value / 1000.0;
244	}
245	/// Converts the supplied Joules value to Kilocalories
246	/// # Arguments
247	/// * `value` - The Joules input value
248	pub fn to_kilocalories(value: f64) -> f64 {
249		return value / 4184.0;
250	}
251	/// Converts the supplied Joules value to Btu
252	/// # Arguments
253	/// * `value` - The Joules input value
254	pub fn to_btu(value: f64) -> f64 {
255		return value / 1055.06;
256	}
257	/// Converts the supplied Joules value to Calories
258	/// # Arguments
259	/// * `value` - The Joules input value
260	pub fn to_calories(value: f64) -> f64 {
261		return value / 4.184;
262	}
263	/// Converts the supplied Joules value to US Therms
264	/// # Arguments
265	/// * `value` - The Joules input value
266	pub fn to_u_s_therms(value: f64) -> f64 {
267		return value / 105480400.0;
268	}
269	/// Converts the supplied Joules value to Watt Hours
270	/// # Arguments
271	/// * `value` - The Joules input value
272	pub fn to_watt_hours(value: f64) -> f64 {
273		return value / 3600.0;
274	}
275	/// Converts the supplied Joules value to Kilowatt Hours
276	/// # Arguments
277	/// * `value` - The Joules input value
278	pub fn to_kilowatt_hours(value: f64) -> f64 {
279		return value / 3.6e+6;
280	}
281	/// Converts the supplied Joules value to Foot Pounds
282	/// # Arguments
283	/// * `value` - The Joules input value
284	pub fn to_foot_pounds(value: f64) -> f64 {
285		return value / 1.35582;
286	}
287	/// Converts the supplied Joules value to Electronvolts
288	/// # Arguments
289	/// * `value` - The Joules input value
290	pub fn to_electronvolts(value: f64) -> f64 {
291		return value * 6241509343300000000.0;
292	}
293}
294/// Kilocalories conversion functions
295pub mod kilocalories {
296	/// Converts the supplied Kilocalories value to Kilojoules
297	/// # Arguments
298	/// * `value` - The Kilocalories input value
299	pub fn to_kilojoules(value: f64) -> f64 {
300		return value * 4.184;
301	}
302	/// Converts the supplied Kilocalories value to Joules
303	/// # Arguments
304	/// * `value` - The Kilocalories input value
305	pub fn to_joules(value: f64) -> f64 {
306		return value * 4184.0;
307	}
308	/// Converts the supplied Kilocalories value to Btu
309	/// # Arguments
310	/// * `value` - The Kilocalories input value
311	pub fn to_btu(value: f64) -> f64 {
312		return value / 0.2521644007218;
313	}
314	/// Converts the supplied Kilocalories value to Calories
315	/// # Arguments
316	/// * `value` - The Kilocalories input value
317	pub fn to_calories(value: f64) -> f64 {
318		return value * 1000.0;
319	}
320	/// Converts the supplied Kilocalories value to US Therms
321	/// # Arguments
322	/// * `value` - The Kilocalories input value
323	pub fn to_u_s_therms(value: f64) -> f64 {
324		return value / 25210.44007218;
325	}
326	/// Converts the supplied Kilocalories value to Watt Hours
327	/// # Arguments
328	/// * `value` - The Kilocalories input value
329	pub fn to_watt_hours(value: f64) -> f64 {
330		return value * 1.16222;
331	}
332	/// Converts the supplied Kilocalories value to Kilowatt Hours
333	/// # Arguments
334	/// * `value` - The Kilocalories input value
335	pub fn to_kilowatt_hours(value: f64) -> f64 {
336		return value / 860.421;
337	}
338	/// Converts the supplied Kilocalories value to Foot Pounds
339	/// # Arguments
340	/// * `value` - The Kilocalories input value
341	pub fn to_foot_pounds(value: f64) -> f64 {
342		return value * 3085.96;
343	}
344	/// Converts the supplied Kilocalories value to Electronvolts
345	/// # Arguments
346	/// * `value` - The Kilocalories input value
347	pub fn to_electronvolts(value: f64) -> f64 {
348		return value * 26131952998320305078272.00;
349	}
350}
351/// Kilojoules conversion functions
352pub mod kilojoules {
353	/// Converts the supplied Kilojoules value to Kilocalories
354	/// # Arguments
355	/// * `value` - The Kilojoules input value
356	pub fn to_kilocalories(value: f64) -> f64 {
357		return value / 4.184;
358	}
359	/// Converts the supplied Kilojoules value to Joules
360	/// # Arguments
361	/// * `value` - The Kilojoules input value
362	pub fn to_joules(value: f64) -> f64 {
363		return value * 1000.0;
364	}
365	/// Converts the supplied Kilojoules value to Btu
366	/// # Arguments
367	/// * `value` - The Kilojoules input value
368	pub fn to_btu(value: f64) -> f64 {
369		return value / 1.0550559;
370	}
371	/// Converts the supplied Kilojoules value to Calories
372	/// # Arguments
373	/// * `value` - The Kilojoules input value
374	pub fn to_calories(value: f64) -> f64 {
375		return value * 239.0057;
376	}
377	/// Converts the supplied Kilojoules value to US Therms
378	/// # Arguments
379	/// * `value` - The Kilojoules input value
380	pub fn to_u_s_therms(value: f64) -> f64 {
381		return value / 105480.04;
382	}
383	/// Converts the supplied Kilojoules value to Watt Hours
384	/// # Arguments
385	/// * `value` - The Kilojoules input value
386	pub fn to_watt_hours(value: f64) -> f64 {
387		return value / 3.6;
388	}
389	/// Converts the supplied Kilojoules value to Kilowatt Hours
390	/// # Arguments
391	/// * `value` - The Kilojoules input value
392	pub fn to_kilowatt_hours(value: f64) -> f64 {
393		return value / 3600.0;
394	}
395	/// Converts the supplied Kilojoules value to Foot Pounds
396	/// # Arguments
397	/// * `value` - The Kilojoules input value
398	pub fn to_foot_pounds(value: f64) -> f64 {
399		return value * 737.562;
400	}
401	/// Converts the supplied Kilojoules value to Electronvolts
402	/// # Arguments
403	/// * `value` - The Kilojoules input value
404	pub fn to_electronvolts(value: f64) -> f64 {
405		return value * 6241509744511500156928.00;
406	}
407}
408/// Kilowatt Hours conversion functions
409pub mod kilowatt_hours {
410	/// Converts the supplied Kilowatt Hours value to Kilojoules
411	/// # Arguments
412	/// * `value` - The Kilowatt Hours input value
413	pub fn to_kilojoules(value: f64) -> f64 {
414		return value * 3600.0;
415	}
416	/// Converts the supplied Kilowatt Hours value to Kilocalories
417	/// # Arguments
418	/// * `value` - The Kilowatt Hours input value
419	pub fn to_kilocalories(value: f64) -> f64 {
420		return value * 860.421;
421	}
422	/// Converts the supplied Kilowatt Hours value to Joules
423	/// # Arguments
424	/// * `value` - The Kilowatt Hours input value
425	pub fn to_joules(value: f64) -> f64 {
426		return value * 3.6e+6;
427	}
428	/// Converts the supplied Kilowatt Hours value to Btu
429	/// # Arguments
430	/// * `value` - The Kilowatt Hours input value
431	pub fn to_btu(value: f64) -> f64 {
432		return value * 3412.14;
433	}
434	/// Converts the supplied Kilowatt Hours value to Calories
435	/// # Arguments
436	/// * `value` - The Kilowatt Hours input value
437	pub fn to_calories(value: f64) -> f64 {
438		return value * 860421.0;
439	}
440	/// Converts the supplied Kilowatt Hours value to US Therms
441	/// # Arguments
442	/// * `value` - The Kilowatt Hours input value
443	pub fn to_u_s_therms(value: f64) -> f64 {
444		return value / 29.3001;
445	}
446	/// Converts the supplied Kilowatt Hours value to Watt Hours
447	/// # Arguments
448	/// * `value` - The Kilowatt Hours input value
449	pub fn to_watt_hours(value: f64) -> f64 {
450		return value * 1000.0;
451	}
452	/// Converts the supplied Kilowatt Hours value to Foot Pounds
453	/// # Arguments
454	/// * `value` - The Kilowatt Hours input value
455	pub fn to_foot_pounds(value: f64) -> f64 {
456		return value / 0.00000037662;
457	}
458	/// Converts the supplied Kilowatt Hours value to Electronvolts
459	/// # Arguments
460	/// * `value` - The Kilowatt Hours input value
461	pub fn to_electronvolts(value: f64) -> f64 {
462		return value * 2.246943e+25;
463	}
464}
465/// US Therms conversion functions
466pub mod u_s_therms {
467	/// Converts the supplied US Therms value to Kilojoules
468	/// # Arguments
469	/// * `value` - The US Therms input value
470	pub fn to_kilojoules(value: f64) -> f64 {
471		return value * 105480.04;
472	}
473	/// Converts the supplied US Therms value to Kilocalories
474	/// # Arguments
475	/// * `value` - The US Therms input value
476	pub fn to_kilocalories(value: f64) -> f64 {
477		return value * 25210.44007218;
478	}
479	/// Converts the supplied US Therms value to Joules
480	/// # Arguments
481	/// * `value` - The US Therms input value
482	pub fn to_joules(value: f64) -> f64 {
483		return value * 105480400.0;
484	}
485	/// Converts the supplied US Therms value to Btu
486	/// # Arguments
487	/// * `value` - The US Therms input value
488	pub fn to_btu(value: f64) -> f64 {
489		return value * 99976.12448781215;
490	}
491	/// Converts the supplied US Therms value to Calories
492	/// # Arguments
493	/// * `value` - The US Therms input value
494	pub fn to_calories(value: f64) -> f64 {
495		return value * 25210420.0;
496	}
497	/// Converts the supplied US Therms value to Watt Hours
498	/// # Arguments
499	/// * `value` - The US Therms input value
500	pub fn to_watt_hours(value: f64) -> f64 {
501		return value * 29300.1;
502	}
503	/// Converts the supplied US Therms value to Kilowatt Hours
504	/// # Arguments
505	/// * `value` - The US Therms input value
506	pub fn to_kilowatt_hours(value: f64) -> f64 {
507		return value * 29.3001;
508	}
509	/// Converts the supplied US Therms value to Foot Pounds
510	/// # Arguments
511	/// * `value` - The US Therms input value
512	pub fn to_foot_pounds(value: f64) -> f64 {
513		return value * 77816937.099186;
514	}
515	/// Converts the supplied US Therms value to Electronvolts
516	/// # Arguments
517	/// * `value` - The US Therms input value
518	pub fn to_electronvolts(value: f64) -> f64 {
519		return value * 6.5835660010911e+26;
520	}
521}
522/// Watt Hours conversion functions
523pub mod watt_hours {
524	/// Converts the supplied Watt Hours value to Kilojoules
525	/// # Arguments
526	/// * `value` - The Watt Hours input value
527	pub fn to_kilojoules(value: f64) -> f64 {
528		return value * 3.6;
529	}
530	/// Converts the supplied Watt Hours value to Kilocalories
531	/// # Arguments
532	/// * `value` - The Watt Hours input value
533	pub fn to_kilocalories(value: f64) -> f64 {
534		return value / 1.16222;
535	}
536	/// Converts the supplied Watt Hours value to Joules
537	/// # Arguments
538	/// * `value` - The Watt Hours input value
539	pub fn to_joules(value: f64) -> f64 {
540		return value * 3600.0;
541	}
542	/// Converts the supplied Watt Hours value to Btu
543	/// # Arguments
544	/// * `value` - The Watt Hours input value
545	pub fn to_btu(value: f64) -> f64 {
546		return value / 0.293071;
547	}
548	/// Converts the supplied Watt Hours value to Calories
549	/// # Arguments
550	/// * `value` - The Watt Hours input value
551	pub fn to_calories(value: f64) -> f64 {
552		return value / 0.00116222;
553	}
554	/// Converts the supplied Watt Hours value to US Therms
555	/// # Arguments
556	/// * `value` - The Watt Hours input value
557	pub fn to_u_s_therms(value: f64) -> f64 {
558		return value / 29300.1;
559	}
560	/// Converts the supplied Watt Hours value to Kilowatt Hours
561	/// # Arguments
562	/// * `value` - The Watt Hours input value
563	pub fn to_kilowatt_hours(value: f64) -> f64 {
564		return value / 1000.0;
565	}
566	/// Converts the supplied Watt Hours value to Foot Pounds
567	/// # Arguments
568	/// * `value` - The Watt Hours input value
569	pub fn to_foot_pounds(value: f64) -> f64 {
570		return value * 2655.22;
571	}
572	/// Converts the supplied Watt Hours value to Electronvolts
573	/// # Arguments
574	/// * `value` - The Watt Hours input value
575	pub fn to_electronvolts(value: f64) -> f64 {
576		return value * 2.2469422907138e+22;
577	}
578}