-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAbsorbedDose.g.cs
More file actions
33 lines (28 loc) · 1.5 KB
/
AbsorbedDose.g.cs
File metadata and controls
33 lines (28 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (c) ktsu.dev
// All rights reserved.
// Licensed under the MIT license.
// <auto-generated />
namespace ktsu.Semantics.Quantities;
using System.Numerics;
/// <summary>
/// Magnitude (Vector0) quantity for the AbsorbedDose dimension.
/// </summary>
/// <typeparam name="T">The numeric storage type.</typeparam>
public record AbsorbedDose<T> : PhysicalQuantity<AbsorbedDose<T>, T>, IVector0<AbsorbedDose<T>, T>
where T : struct, INumber<T>
{
/// <summary>Gets a quantity with value zero.</summary>
public static AbsorbedDose<T> Zero => Create(T.Zero);
/// <summary>
/// Creates a new <see cref="AbsorbedDose{T}"/> from a value in Gray.
/// </summary>
/// <param name="value">The value in Gray.</param>
/// <returns>A new <see cref="AbsorbedDose{T}"/> instance.</returns>
/// <exception cref="System.ArgumentException">Thrown when the resulting magnitude would be negative.</exception>
public static AbsorbedDose<T> FromGrays(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value)));
/// <summary>
/// Subtracts two AbsorbedDose values, returning the absolute difference as a non-negative AbsorbedDose.
/// Magnitude subtraction stays a magnitude (per the unified-vector model).
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")] public static AbsorbedDose<T> operator -(AbsorbedDose<T> left, AbsorbedDose<T> right) => Create(T.Abs(left.Quantity - right.Quantity));
};