-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAirspeed.g.cs
More file actions
32 lines (27 loc) · 1.56 KB
/
Airspeed.g.cs
File metadata and controls
32 lines (27 loc) · 1.56 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
// Copyright (c) ktsu.dev
// All rights reserved.
// Licensed under the MIT license.
// <auto-generated />
namespace ktsu.Semantics.Quantities;
using System.Numerics;
/// <summary>
/// Speed relative to the air.
/// Semantic overload of <see cref="Speed{T}"/>.
/// </summary>
/// <typeparam name="T">The numeric storage type.</typeparam>
public record Airspeed<T> : PhysicalQuantity<Airspeed<T>, T>, IVector0<Airspeed<T>, T>
where T : struct, INumber<T>
{
/// <summary>Gets a quantity with value zero.</summary>
public static Airspeed<T> Zero => Create(T.Zero);
/// <summary>Creates a new Airspeed from a value in MetersPerSecond.</summary>
public static Airspeed<T> FromMetersPerSecond(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value)));
/// <summary>Implicit conversion to Speed.</summary>
public static implicit operator Speed<T>(Airspeed<T> value) => Speed<T>.Create(value.Value);
/// <summary>Explicit conversion from Speed.</summary>
public static explicit operator Airspeed<T>(Speed<T> value) => Create(value.Value);
/// <summary>Creates a Airspeed from a Speed value.</summary>
public static Airspeed<T> From(Speed<T> value) => Create(value.Value);
/// <summary>Subtracts two Airspeed values, returning the absolute difference as a non-negative Airspeed.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")] public static Airspeed<T> operator -(Airspeed<T> left, Airspeed<T> right) => Create(T.Abs(left.Quantity - right.Quantity));
};