Closed jcracine-cimeq closed 1 year ago
Maybe this will help you: https://github.com/nholthaus/units/blob/3ca0e22c5e5088a93f930617d193e895eb538bca/include/units.h#L3823
Maybe that can do the trick, but technically there's a distinct difference between resistance and impedance as the first one applies to DC and the latter to AC.
Required Specs:
Problem: I'm trying to add ohms as a new units to help calculating formulas with NTC Thermistors for a project, and it's the first time I'm trying to implement a new custom unit using the available macros. I tried using the
UNIT_ADD_WITH_METRIC_PREFIXES()
macro to do that, but I'm not sure which base unit I should base it when I create my definition. So far, I haveUNIT_ADD_WITH_METRIC_PREFIXES(resistance, ohm, ohms, ohms, units::unit<std::ratio<1,1>, ?>)
.Also, I'm not sure if I understood correctly but could it work if I used a compound_unit instead like this:
using resistance = units::compound_unit<units::voltage::volts,units::inverse<units::current::amperes>>
?