Measurement units, including imperial and SI units

View versions (1)

Interface

#include <codecogs/units/convert/power.h>

using namespace Units::Convert;

Overview

The standard measurement units are:

Unit names Alternate names / spellings Abbreviation Enumeration Code Conversion Rate (relative to first unit)
Power
Watts Watts W unit_W 1
British Thermal Unit/hour BTU/hour BTU/hr unit_BTU-hr 3.415179027
British Thermal Unit/minute BTU/minute BTU/min unit_BTU-min 0.05691965
British Thermal Unit/second BTU/second BTU/sec unit_BTU-sec 0.000948661
Calories/second Calorie/second cal/sec unit_cal-sec 0.239058511
Horsepower Horse power hp unit_hp 0.001341022
Pound-feet/minute Pound-foot/minute lb.ft/min unit_lb_ft-min 44.25372896
Pound-feet/second Pound-foot/second lb ft/sec unit_lb_ft-sec 0.737562149
GPL Licence — free for non commercial use. See Licence details.

FUNCTION

power

Converts numbers from one power unit to another.

Example 1

#include <iostream>
#include <codecogs/units/convert/power.h>

using namespace Units::Convert;
int main()
{
  std::cout << "power(10.2,unit_BTU_min, unit_W)=" << power(10.2,unit_BTU_min, unit_W);

  return 0;
}

Output:

power(10.2,unit_BTU_min, unit_W)= 179.19997609543

Parameters

number
the value in from_unit 's to convert
from_unit
an enumerated value of the initial power type
to_unit
an emuerated value of the output power type

Returns

the value in the converted unit.