2023-02-26 09:38:28 +00:00
|
|
|
using DecimalMath;
|
2023-02-26 14:39:55 +00:00
|
|
|
using InnovEnergy.Lib.Units.Generator;
|
2023-02-26 09:38:28 +00:00
|
|
|
using InnovEnergy.Lib.Utils;
|
|
|
|
|
|
|
|
namespace InnovEnergy.Lib.Units;
|
|
|
|
|
2023-03-20 12:22:57 +00:00
|
|
|
[Generate]
|
2023-02-26 14:39:55 +00:00
|
|
|
public readonly partial struct Angle
|
2023-02-26 09:38:28 +00:00
|
|
|
{
|
|
|
|
public static String Unit => "rad";
|
|
|
|
public static String Symbol => "∠";
|
|
|
|
|
|
|
|
public static readonly Angle Pi = new Angle(DecimalEx.Pi);
|
|
|
|
|
|
|
|
|
|
|
|
public Angle(Decimal value)
|
|
|
|
{
|
|
|
|
var modulo = value.Modulo(DecimalEx.TwoPi);
|
|
|
|
|
|
|
|
Value = modulo > DecimalEx.Pi
|
|
|
|
? modulo - DecimalEx.TwoPi
|
|
|
|
: modulo;
|
|
|
|
}
|
2023-02-26 14:39:55 +00:00
|
|
|
|
2023-02-26 09:38:28 +00:00
|
|
|
}
|