Innovenergy_trunk/csharp/Lib/Units/Power.cs

19 lines
499 B
C#
Raw Normal View History

2023-02-26 14:39:55 +00:00
using InnovEnergy.Lib.Units.Generator;
2023-02-26 14:39:55 +00:00
namespace InnovEnergy.Lib.Units;
2023-02-26 18:19:16 +00:00
[Sum]
2023-02-26 14:39:55 +00:00
public readonly partial struct Power
{
public static String Unit => "W";
public static String Symbol => "P";
public Power(Decimal value) => Value = value;
// P=UI
public static Voltage operator /(Power power, Current current) => new Voltage(power.Value / current.Value);
public static Current operator /(Power power, Voltage voltage) => new Current(power.Value / voltage.Value);
}