-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathActivationEnergy.g.cs
More file actions
44 lines (39 loc) · 2.51 KB
/
ActivationEnergy.g.cs
File metadata and controls
44 lines (39 loc) · 2.51 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
33
34
35
36
37
38
39
40
41
42
43
// Copyright (c) ktsu.dev
// All rights reserved.
// Licensed under the MIT license.
// <auto-generated />
namespace ktsu.Semantics.Quantities;
using System.Numerics;
/// <summary>
/// Minimum energy for a chemical reaction to occur.
/// Semantic overload of <see cref="MolarEnergy{T}"/>.
/// </summary>
/// <typeparam name="T">The numeric storage type.</typeparam>
public record ActivationEnergy<T> : PhysicalQuantity<ActivationEnergy<T>, T>, IVector0<ActivationEnergy<T>, T>
where T : struct, INumber<T>
{
/// <summary>Gets a quantity with value zero.</summary>
public static ActivationEnergy<T> Zero => Create(T.Zero);
/// <summary>
/// Creates a new ActivationEnergy from a value in JoulePerMole.
/// </summary>
/// <param name="value">The value in JoulePerMole.</param>
/// <returns>A new ActivationEnergy instance.</returns>
/// <exception cref="System.ArgumentException">Thrown when the resulting magnitude would be negative.</exception>
public static ActivationEnergy<T> FromJoulePerMole(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value)));
/// <summary>
/// Creates a new ActivationEnergy from a value in KilojoulePerMole.
/// </summary>
/// <param name="value">The value in KilojoulePerMole.</param>
/// <returns>A new ActivationEnergy instance.</returns>
/// <exception cref="System.ArgumentException">Thrown when the resulting magnitude would be negative.</exception>
public static ActivationEnergy<T> FromKilojoulePerMole(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilojoulePerMoleToJoulePerMole)), nameof(value)));
/// <summary>Implicit conversion to MolarEnergy.</summary>
public static implicit operator MolarEnergy<T>(ActivationEnergy<T> value) => MolarEnergy<T>.Create(value.Value);
/// <summary>Explicit conversion from MolarEnergy.</summary>
public static explicit operator ActivationEnergy<T>(MolarEnergy<T> value) => Create(value.Value);
/// <summary>Creates a ActivationEnergy from a MolarEnergy value.</summary>
public static ActivationEnergy<T> From(MolarEnergy<T> value) => Create(value.Value);
/// <summary>Subtracts two ActivationEnergy values, returning the absolute difference as a non-negative ActivationEnergy.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")] public static ActivationEnergy<T> operator -(ActivationEnergy<T> left, ActivationEnergy<T> right) => Create(T.Abs(left.Quantity - right.Quantity));
};