20 lines
562 B
C#
20 lines
562 B
C#
using InnovEnergy.Lib.SrcGen;
|
|
using InnovEnergy.Lib.SrcGen.Attributes;
|
|
|
|
namespace InnovEnergy.Lib.Units;
|
|
|
|
[Generate<Operators>][Generate<Sum>]
|
|
public readonly partial struct Current
|
|
{
|
|
public static String Unit => "A";
|
|
public static String Symbol => "I";
|
|
|
|
|
|
|
|
// P=UI
|
|
public static ActivePower operator *(Current current, Voltage voltage) => new ActivePower(current.Value * voltage.Value);
|
|
|
|
// U=RI
|
|
public static Voltage operator *(Current current, Resistance resistance) => new Voltage(resistance.Value* current.Value);
|
|
|
|
} |