forked from angularsen/UnitsNet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPower.g.cs
More file actions
517 lines (431 loc) · 25.3 KB
/
Power.g.cs
File metadata and controls
517 lines (431 loc) · 25.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by \generate-code.bat.
//
// Changes to this file will be lost when the code is regenerated.
// The build server regenerates the code before each build and a pre-build
// step will regenerate the code on each local build.
//
// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
//
// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities.
//
// </auto-generated>
//------------------------------------------------------------------------------
// Licensed under MIT No Attribution, see LICENSE file at the root.
// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet.
using System;
using UnitsNet.Units;
namespace UnitsNet
{
/// <inheritdoc />
/// <summary>
/// In physics, power is the rate of doing work. It is equivalent to an amount of energy consumed per unit time.
/// </summary>
public struct Power
{
/// <summary>
/// The numeric value this quantity was constructed with.
/// </summary>
private readonly double _value;
/// <summary>
/// The unit this quantity was constructed with.
/// </summary>
private readonly PowerUnit _unit;
/// <summary>
/// The numeric value this quantity was constructed with.
/// </summary>
public double Value => _value;
/// <inheritdoc />
public PowerUnit Unit => _unit;
/// <summary>
/// Creates the quantity with the given numeric value and unit.
/// </summary>
/// <param name="value">The numeric value to construct this quantity with.</param>
/// <param name="unit">The unit representation to construct this quantity with.</param>
public Power(double value, PowerUnit unit)
{
_value = value;
_unit = unit;
}
/// <summary>
/// The base unit of Power, which is Second. All conversions go via this value.
/// </summary>
public static PowerUnit BaseUnit { get; } = PowerUnit.Watt;
/// <summary>
/// Represents the largest possible value of Power.
/// </summary>
public static Power MaxValue { get; } = new Power(double.MaxValue, BaseUnit);
/// <summary>
/// Represents the smallest possible value of Power.
/// </summary>
public static Power MinValue { get; } = new Power(double.MinValue, BaseUnit);
/// <summary>
/// Gets an instance of this quantity with a value of 0 in the base unit Second.
/// </summary>
public static Power Zero { get; } = new Power(0, BaseUnit);
#region Conversion Properties
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.BoilerHorsepower"/>
/// </summary>
public double BoilerHorsepower => As(PowerUnit.BoilerHorsepower);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.BritishThermalUnitPerHour"/>
/// </summary>
public double BritishThermalUnitsPerHour => As(PowerUnit.BritishThermalUnitPerHour);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.CaloriePerHour"/>
/// </summary>
public double CaloriesPerHour => As(PowerUnit.CaloriePerHour);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.Decawatt"/>
/// </summary>
public double Decawatts => As(PowerUnit.Decawatt);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.Deciwatt"/>
/// </summary>
public double Deciwatts => As(PowerUnit.Deciwatt);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.ElectricalHorsepower"/>
/// </summary>
public double ElectricalHorsepower => As(PowerUnit.ElectricalHorsepower);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.Femtowatt"/>
/// </summary>
public double Femtowatts => As(PowerUnit.Femtowatt);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.GigacaloriePerHour"/>
/// </summary>
public double GigacaloriesPerHour => As(PowerUnit.GigacaloriePerHour);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.GigajoulePerHour"/>
/// </summary>
public double GigajoulesPerHour => As(PowerUnit.GigajoulePerHour);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.Gigawatt"/>
/// </summary>
public double Gigawatts => As(PowerUnit.Gigawatt);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.HydraulicHorsepower"/>
/// </summary>
public double HydraulicHorsepower => As(PowerUnit.HydraulicHorsepower);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.JoulePerHour"/>
/// </summary>
public double JoulesPerHour => As(PowerUnit.JoulePerHour);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.KilobritishThermalUnitPerHour"/>
/// </summary>
public double KilobritishThermalUnitsPerHour => As(PowerUnit.KilobritishThermalUnitPerHour);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.KilocaloriePerHour"/>
/// </summary>
public double KilocaloriesPerHour => As(PowerUnit.KilocaloriePerHour);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.KilojoulePerHour"/>
/// </summary>
public double KilojoulesPerHour => As(PowerUnit.KilojoulePerHour);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.Kilowatt"/>
/// </summary>
public double Kilowatts => As(PowerUnit.Kilowatt);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.MechanicalHorsepower"/>
/// </summary>
public double MechanicalHorsepower => As(PowerUnit.MechanicalHorsepower);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.MegabritishThermalUnitPerHour"/>
/// </summary>
public double MegabritishThermalUnitsPerHour => As(PowerUnit.MegabritishThermalUnitPerHour);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.MegacaloriePerHour"/>
/// </summary>
public double MegacaloriesPerHour => As(PowerUnit.MegacaloriePerHour);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.MegajoulePerHour"/>
/// </summary>
public double MegajoulesPerHour => As(PowerUnit.MegajoulePerHour);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.Megawatt"/>
/// </summary>
public double Megawatts => As(PowerUnit.Megawatt);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.MetricHorsepower"/>
/// </summary>
public double MetricHorsepower => As(PowerUnit.MetricHorsepower);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.Microwatt"/>
/// </summary>
public double Microwatts => As(PowerUnit.Microwatt);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.MillijoulePerHour"/>
/// </summary>
public double MillijoulesPerHour => As(PowerUnit.MillijoulePerHour);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.Milliwatt"/>
/// </summary>
public double Milliwatts => As(PowerUnit.Milliwatt);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.Nanowatt"/>
/// </summary>
public double Nanowatts => As(PowerUnit.Nanowatt);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.Petawatt"/>
/// </summary>
public double Petawatts => As(PowerUnit.Petawatt);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.Picowatt"/>
/// </summary>
public double Picowatts => As(PowerUnit.Picowatt);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.Terawatt"/>
/// </summary>
public double Terawatts => As(PowerUnit.Terawatt);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.TonOfRefrigeration"/>
/// </summary>
public double TonsOfRefrigeration => As(PowerUnit.TonOfRefrigeration);
/// <summary>
/// Gets a <see cref="double"/> value of this quantity converted into <see cref="PowerUnit.Watt"/>
/// </summary>
public double Watts => As(PowerUnit.Watt);
#endregion
#region Static Factory Methods
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.BoilerHorsepower"/>.
/// </summary>
public static Power FromBoilerHorsepower(double boilerhorsepower) => new Power(boilerhorsepower, PowerUnit.BoilerHorsepower);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.BritishThermalUnitPerHour"/>.
/// </summary>
public static Power FromBritishThermalUnitsPerHour(double britishthermalunitsperhour) => new Power(britishthermalunitsperhour, PowerUnit.BritishThermalUnitPerHour);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.CaloriePerHour"/>.
/// </summary>
public static Power FromCaloriesPerHour(double caloriesperhour) => new Power(caloriesperhour, PowerUnit.CaloriePerHour);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.Decawatt"/>.
/// </summary>
public static Power FromDecawatts(double decawatts) => new Power(decawatts, PowerUnit.Decawatt);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.Deciwatt"/>.
/// </summary>
public static Power FromDeciwatts(double deciwatts) => new Power(deciwatts, PowerUnit.Deciwatt);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.ElectricalHorsepower"/>.
/// </summary>
public static Power FromElectricalHorsepower(double electricalhorsepower) => new Power(electricalhorsepower, PowerUnit.ElectricalHorsepower);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.Femtowatt"/>.
/// </summary>
public static Power FromFemtowatts(double femtowatts) => new Power(femtowatts, PowerUnit.Femtowatt);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.GigacaloriePerHour"/>.
/// </summary>
public static Power FromGigacaloriesPerHour(double gigacaloriesperhour) => new Power(gigacaloriesperhour, PowerUnit.GigacaloriePerHour);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.GigajoulePerHour"/>.
/// </summary>
public static Power FromGigajoulesPerHour(double gigajoulesperhour) => new Power(gigajoulesperhour, PowerUnit.GigajoulePerHour);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.Gigawatt"/>.
/// </summary>
public static Power FromGigawatts(double gigawatts) => new Power(gigawatts, PowerUnit.Gigawatt);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.HydraulicHorsepower"/>.
/// </summary>
public static Power FromHydraulicHorsepower(double hydraulichorsepower) => new Power(hydraulichorsepower, PowerUnit.HydraulicHorsepower);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.JoulePerHour"/>.
/// </summary>
public static Power FromJoulesPerHour(double joulesperhour) => new Power(joulesperhour, PowerUnit.JoulePerHour);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.KilobritishThermalUnitPerHour"/>.
/// </summary>
public static Power FromKilobritishThermalUnitsPerHour(double kilobritishthermalunitsperhour) => new Power(kilobritishthermalunitsperhour, PowerUnit.KilobritishThermalUnitPerHour);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.KilocaloriePerHour"/>.
/// </summary>
public static Power FromKilocaloriesPerHour(double kilocaloriesperhour) => new Power(kilocaloriesperhour, PowerUnit.KilocaloriePerHour);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.KilojoulePerHour"/>.
/// </summary>
public static Power FromKilojoulesPerHour(double kilojoulesperhour) => new Power(kilojoulesperhour, PowerUnit.KilojoulePerHour);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.Kilowatt"/>.
/// </summary>
public static Power FromKilowatts(double kilowatts) => new Power(kilowatts, PowerUnit.Kilowatt);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.MechanicalHorsepower"/>.
/// </summary>
public static Power FromMechanicalHorsepower(double mechanicalhorsepower) => new Power(mechanicalhorsepower, PowerUnit.MechanicalHorsepower);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.MegabritishThermalUnitPerHour"/>.
/// </summary>
public static Power FromMegabritishThermalUnitsPerHour(double megabritishthermalunitsperhour) => new Power(megabritishthermalunitsperhour, PowerUnit.MegabritishThermalUnitPerHour);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.MegacaloriePerHour"/>.
/// </summary>
public static Power FromMegacaloriesPerHour(double megacaloriesperhour) => new Power(megacaloriesperhour, PowerUnit.MegacaloriePerHour);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.MegajoulePerHour"/>.
/// </summary>
public static Power FromMegajoulesPerHour(double megajoulesperhour) => new Power(megajoulesperhour, PowerUnit.MegajoulePerHour);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.Megawatt"/>.
/// </summary>
public static Power FromMegawatts(double megawatts) => new Power(megawatts, PowerUnit.Megawatt);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.MetricHorsepower"/>.
/// </summary>
public static Power FromMetricHorsepower(double metrichorsepower) => new Power(metrichorsepower, PowerUnit.MetricHorsepower);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.Microwatt"/>.
/// </summary>
public static Power FromMicrowatts(double microwatts) => new Power(microwatts, PowerUnit.Microwatt);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.MillijoulePerHour"/>.
/// </summary>
public static Power FromMillijoulesPerHour(double millijoulesperhour) => new Power(millijoulesperhour, PowerUnit.MillijoulePerHour);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.Milliwatt"/>.
/// </summary>
public static Power FromMilliwatts(double milliwatts) => new Power(milliwatts, PowerUnit.Milliwatt);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.Nanowatt"/>.
/// </summary>
public static Power FromNanowatts(double nanowatts) => new Power(nanowatts, PowerUnit.Nanowatt);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.Petawatt"/>.
/// </summary>
public static Power FromPetawatts(double petawatts) => new Power(petawatts, PowerUnit.Petawatt);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.Picowatt"/>.
/// </summary>
public static Power FromPicowatts(double picowatts) => new Power(picowatts, PowerUnit.Picowatt);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.Terawatt"/>.
/// </summary>
public static Power FromTerawatts(double terawatts) => new Power(terawatts, PowerUnit.Terawatt);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.TonOfRefrigeration"/>.
/// </summary>
public static Power FromTonsOfRefrigeration(double tonsofrefrigeration) => new Power(tonsofrefrigeration, PowerUnit.TonOfRefrigeration);
/// <summary>
/// Creates a <see cref="Power"/> from <see cref="PowerUnit.Watt"/>.
/// </summary>
public static Power FromWatts(double watts) => new Power(watts, PowerUnit.Watt);
/// <summary>
/// Dynamically convert from value and unit enum <see cref="PowerUnit" /> to <see cref="Power" />.
/// </summary>
/// <param name="value">Value to convert from.</param>
/// <param name="fromUnit">Unit to convert from.</param>
/// <returns>Power unit value.</returns>
public static Power From(double value, PowerUnit fromUnit)
{
return new Power(value, fromUnit);
}
#endregion
#region Conversion Methods
/// <summary>
/// Convert to the unit representation <paramref name="unit" />.
/// </summary>
/// <returns>Value converted to the specified unit.</returns>
public double As(PowerUnit unit) => GetValueAs(unit);
/// <summary>
/// Converts this Power to another Power with the unit representation <paramref name="unit" />.
/// </summary>
/// <returns>A Power with the specified unit.</returns>
public Power ToUnit(PowerUnit unit)
{
var convertedValue = GetValueAs(unit);
return new Power(convertedValue, unit);
}
/// <summary>
/// Converts the current value + unit to the base unit.
/// This is typically the first step in converting from one unit to another.
/// </summary>
/// <returns>The value in the base unit representation.</returns>
private double GetValueInBaseUnit()
{
return Unit switch
{
PowerUnit.BoilerHorsepower => _value * 9812.5,
PowerUnit.BritishThermalUnitPerHour => _value * 1055.05585262 / 3600,
PowerUnit.CaloriePerHour => _value / 859.8452279,
PowerUnit.Decawatt => (_value) * 1e1d,
PowerUnit.Deciwatt => (_value) * 1e-1d,
PowerUnit.ElectricalHorsepower => _value * 746,
PowerUnit.Femtowatt => (_value) * 1e-15d,
PowerUnit.GigacaloriePerHour => (_value / 859.8452279) * 1e9d,
PowerUnit.GigajoulePerHour => (_value / 3600) * 1e9d,
PowerUnit.Gigawatt => (_value) * 1e9d,
PowerUnit.HydraulicHorsepower => _value * 745.69987158227022,
PowerUnit.JoulePerHour => _value / 3600,
PowerUnit.KilobritishThermalUnitPerHour => (_value * 1055.05585262 / 3600) * 1e3d,
PowerUnit.KilocaloriePerHour => (_value / 859.8452279) * 1e3d,
PowerUnit.KilojoulePerHour => (_value / 3600) * 1e3d,
PowerUnit.Kilowatt => (_value) * 1e3d,
PowerUnit.MechanicalHorsepower => _value * 76.0402249 * 9.80665,
PowerUnit.MegabritishThermalUnitPerHour => (_value * 1055.05585262 / 3600) * 1e6d,
PowerUnit.MegacaloriePerHour => (_value / 859.8452279) * 1e6d,
PowerUnit.MegajoulePerHour => (_value / 3600) * 1e6d,
PowerUnit.Megawatt => (_value) * 1e6d,
PowerUnit.MetricHorsepower => _value * 75 * 9.80665,
PowerUnit.Microwatt => (_value) * 1e-6d,
PowerUnit.MillijoulePerHour => (_value / 3600) * 1e-3d,
PowerUnit.Milliwatt => (_value) * 1e-3d,
PowerUnit.Nanowatt => (_value) * 1e-9d,
PowerUnit.Petawatt => (_value) * 1e15d,
PowerUnit.Picowatt => (_value) * 1e-12d,
PowerUnit.Terawatt => (_value) * 1e12d,
PowerUnit.TonOfRefrigeration => _value * 3516.853,
PowerUnit.Watt => _value,
_ => throw new NotImplementedException($"Can not convert {Unit} to base units.")
};
}
private double GetValueAs(PowerUnit unit)
{
if (Unit == unit)
return _value;
var baseUnitValue = GetValueInBaseUnit();
return unit switch
{
PowerUnit.BoilerHorsepower => baseUnitValue / 9812.5,
PowerUnit.BritishThermalUnitPerHour => baseUnitValue * 3600 / 1055.05585262,
PowerUnit.CaloriePerHour => baseUnitValue * 859.8452279,
PowerUnit.Decawatt => (baseUnitValue) / 1e1d,
PowerUnit.Deciwatt => (baseUnitValue) / 1e-1d,
PowerUnit.ElectricalHorsepower => baseUnitValue / 746,
PowerUnit.Femtowatt => (baseUnitValue) / 1e-15d,
PowerUnit.GigacaloriePerHour => (baseUnitValue * 859.8452279) / 1e9d,
PowerUnit.GigajoulePerHour => (baseUnitValue * 3600) / 1e9d,
PowerUnit.Gigawatt => (baseUnitValue) / 1e9d,
PowerUnit.HydraulicHorsepower => baseUnitValue / 745.69987158227022,
PowerUnit.JoulePerHour => baseUnitValue * 3600,
PowerUnit.KilobritishThermalUnitPerHour => (baseUnitValue * 3600 / 1055.05585262) / 1e3d,
PowerUnit.KilocaloriePerHour => (baseUnitValue * 859.8452279) / 1e3d,
PowerUnit.KilojoulePerHour => (baseUnitValue * 3600) / 1e3d,
PowerUnit.Kilowatt => (baseUnitValue) / 1e3d,
PowerUnit.MechanicalHorsepower => baseUnitValue / (76.0402249 * 9.80665),
PowerUnit.MegabritishThermalUnitPerHour => (baseUnitValue * 3600 / 1055.05585262) / 1e6d,
PowerUnit.MegacaloriePerHour => (baseUnitValue * 859.8452279) / 1e6d,
PowerUnit.MegajoulePerHour => (baseUnitValue * 3600) / 1e6d,
PowerUnit.Megawatt => (baseUnitValue) / 1e6d,
PowerUnit.MetricHorsepower => baseUnitValue / (75 * 9.80665),
PowerUnit.Microwatt => (baseUnitValue) / 1e-6d,
PowerUnit.MillijoulePerHour => (baseUnitValue * 3600) / 1e-3d,
PowerUnit.Milliwatt => (baseUnitValue) / 1e-3d,
PowerUnit.Nanowatt => (baseUnitValue) / 1e-9d,
PowerUnit.Petawatt => (baseUnitValue) / 1e15d,
PowerUnit.Picowatt => (baseUnitValue) / 1e-12d,
PowerUnit.Terawatt => (baseUnitValue) / 1e12d,
PowerUnit.TonOfRefrigeration => baseUnitValue / 3516.853,
PowerUnit.Watt => baseUnitValue,
_ => throw new NotImplementedException($"Can not convert {Unit} to {unit}.")
};
}
#endregion
}
}