Struct SpeedVector3
A 3D vector whose components represent speed, each expressed as a UnitsNet.Speed.
public readonly record struct SpeedVector3 : IEquatable<SpeedVector3>
- Implements
- Inherited Members
- Extension Methods
Constructors
SpeedVector3(Speed, Speed, Speed)
Constructs a SpeedVector3 from three UnitsNet.Speed components.
public SpeedVector3(Speed x, Speed y, Speed z)
Parameters
xSpeedThe X component.
ySpeedThe Y component.
zSpeedThe Z component.
Properties
Magnitude
Returns the Euclidean magnitude of this vector as a UnitsNet.Speed. The result is expressed in the same unit as the X component.
public Speed Magnitude { get; }
Property Value
- Speed
X
The X component.
public Speed X { get; }
Property Value
- Speed
Y
The Y component.
public Speed Y { get; }
Property Value
- Speed
Z
The Z component.
public Speed Z { get; }
Property Value
- Speed
Zero
A SpeedVector3 with all components set to zero.
public static SpeedVector3 Zero { get; }
Property Value
Methods
Abs()
Returns a vector with each component replaced by its absolute value.
public SpeedVector3 Abs()
Returns
- SpeedVector3
A SpeedVector3 with non-negative components.
Add(SpeedVector3)
Adds two vectors component-wise.
public SpeedVector3 Add(SpeedVector3 other)
Parameters
otherSpeedVector3The vector to add.
Returns
- SpeedVector3
The component-wise sum.
ApproximatelyEquals(SpeedVector3, Speed)
Returns true if each component of this vector is within
tolerance of the corresponding component of other.
public bool ApproximatelyEquals(SpeedVector3 other, Speed tolerance)
Parameters
otherSpeedVector3The vector to compare against.
toleranceSpeedThe maximum allowed difference per component (inclusive).
Returns
- bool
true when |X - other.X| <= tolerance, |Y - other.Y| <= tolerance, and |Z - other.Z| <= tolerance.
As(SpeedUnit)
Projects all three components into the requested unit, returning a unit-less DoubleVector3.
public DoubleVector3 As(SpeedUnit unit)
Parameters
unitSpeedUnitThe target unit for each component.
Returns
- DoubleVector3
A DoubleVector3 with components expressed in
unit.
AsDefault()
Returns all three components expressed in the SI base unit as a DoubleVector3.
public DoubleVector3 AsDefault()
Returns
- DoubleVector3
A DoubleVector3 with components in the default SI unit.
Clamp(SpeedVector3, SpeedVector3)
Returns a vector with each component clamped to the range [min, max].
public SpeedVector3 Clamp(SpeedVector3 min, SpeedVector3 max)
Parameters
minSpeedVector3The lower bound vector (inclusive, per component).
maxSpeedVector3The upper bound vector (inclusive, per component).
Returns
- SpeedVector3
A SpeedVector3 with each component in [min, max].
Divide(double)
Divides the vector by a scalar divisor.
public SpeedVector3 Divide(double scalar)
Parameters
scalardoubleThe scalar divisor.
Returns
- SpeedVector3
The divided vector.
Dot(ForceVector3)
Returns the instantaneous mechanical power delivered by a force to an object moving at this velocity (P = v⃗ · F⃗), expressed as UnitsNet.Power.
Power is the rate at which work is done. It equals the dot product of velocity
and force: P = v · F · cos(θ), where θ is the angle between the two vectors.
Only the component of force aligned with the direction of motion does
work — a perpendicular force does no work (e.g. centripetal force on a circular path,
or lift perpendicular to flight direction).
public Power Dot(ForceVector3 other)
Parameters
otherForceVector3The force vector acting on the object. Typically the net propulsive force.
Returns
- Power
The instantaneous power in watts (W). Positive = power input; negative = braking.
Examples
// Engine thrust of 1000 N forward (+Z), velocity 20 m/s forward
var velocity = new SpeedVector3(Speed.Zero, Speed.Zero, Speed.FromMetersPerSecond(20));
var thrust = new ForceVector3(Force.Zero, Force.Zero, Force.FromNewtons(1000));
Power power = velocity.Dot(thrust); // 20 000 W = 20 kW
Equals(SpeedVector3)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(SpeedVector3 other)
Parameters
otherSpeedVector3An object to compare with this object.
Returns
FromCentimetersPerHour(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromCentimetersPerHour(UnitsNet.QuantityValue).
public static SpeedVector3 FromCentimetersPerHour(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromCentimetersPerMinutes(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromCentimetersPerMinutes(UnitsNet.QuantityValue).
public static SpeedVector3 FromCentimetersPerMinutes(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromCentimetersPerSecond(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromCentimetersPerSecond(UnitsNet.QuantityValue).
public static SpeedVector3 FromCentimetersPerSecond(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromDecimetersPerMinutes(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromDecimetersPerMinutes(UnitsNet.QuantityValue).
public static SpeedVector3 FromDecimetersPerMinutes(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromDecimetersPerSecond(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromDecimetersPerSecond(UnitsNet.QuantityValue).
public static SpeedVector3 FromDecimetersPerSecond(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromFeetPerHour(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromFeetPerHour(UnitsNet.QuantityValue).
public static SpeedVector3 FromFeetPerHour(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromFeetPerMinute(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromFeetPerMinute(UnitsNet.QuantityValue).
public static SpeedVector3 FromFeetPerMinute(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromFeetPerSecond(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromFeetPerSecond(UnitsNet.QuantityValue).
public static SpeedVector3 FromFeetPerSecond(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromInchesPerHour(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromInchesPerHour(UnitsNet.QuantityValue).
public static SpeedVector3 FromInchesPerHour(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromInchesPerMinute(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromInchesPerMinute(UnitsNet.QuantityValue).
public static SpeedVector3 FromInchesPerMinute(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromInchesPerSecond(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromInchesPerSecond(UnitsNet.QuantityValue).
public static SpeedVector3 FromInchesPerSecond(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromKilometersPerHour(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromKilometersPerHour(UnitsNet.QuantityValue).
public static SpeedVector3 FromKilometersPerHour(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromKilometersPerMinutes(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromKilometersPerMinutes(UnitsNet.QuantityValue).
public static SpeedVector3 FromKilometersPerMinutes(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromKilometersPerSecond(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromKilometersPerSecond(UnitsNet.QuantityValue).
public static SpeedVector3 FromKilometersPerSecond(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromKnots(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromKnots(UnitsNet.QuantityValue).
public static SpeedVector3 FromKnots(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromMach(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromMach(UnitsNet.QuantityValue).
public static SpeedVector3 FromMach(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromMetersPerHour(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromMetersPerHour(UnitsNet.QuantityValue).
public static SpeedVector3 FromMetersPerHour(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromMetersPerMinutes(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromMetersPerMinutes(UnitsNet.QuantityValue).
public static SpeedVector3 FromMetersPerMinutes(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromMetersPerSecond(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromMetersPerSecond(UnitsNet.QuantityValue).
public static SpeedVector3 FromMetersPerSecond(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromMicrometersPerMinutes(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromMicrometersPerMinutes(UnitsNet.QuantityValue).
public static SpeedVector3 FromMicrometersPerMinutes(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromMicrometersPerSecond(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromMicrometersPerSecond(UnitsNet.QuantityValue).
public static SpeedVector3 FromMicrometersPerSecond(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromMilesPerHour(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromMilesPerHour(UnitsNet.QuantityValue).
public static SpeedVector3 FromMilesPerHour(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromMillimetersPerHour(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromMillimetersPerHour(UnitsNet.QuantityValue).
public static SpeedVector3 FromMillimetersPerHour(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromMillimetersPerMinutes(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromMillimetersPerMinutes(UnitsNet.QuantityValue).
public static SpeedVector3 FromMillimetersPerMinutes(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromMillimetersPerSecond(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromMillimetersPerSecond(UnitsNet.QuantityValue).
public static SpeedVector3 FromMillimetersPerSecond(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromNanometersPerMinutes(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromNanometersPerMinutes(UnitsNet.QuantityValue).
public static SpeedVector3 FromNanometersPerMinutes(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromNanometersPerSecond(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromNanometersPerSecond(UnitsNet.QuantityValue).
public static SpeedVector3 FromNanometersPerSecond(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromUsSurveyFeetPerHour(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromUsSurveyFeetPerHour(UnitsNet.QuantityValue).
public static SpeedVector3 FromUsSurveyFeetPerHour(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromUsSurveyFeetPerMinute(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromUsSurveyFeetPerMinute(UnitsNet.QuantityValue).
public static SpeedVector3 FromUsSurveyFeetPerMinute(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromUsSurveyFeetPerSecond(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromUsSurveyFeetPerSecond(UnitsNet.QuantityValue).
public static SpeedVector3 FromUsSurveyFeetPerSecond(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromYardsPerHour(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromYardsPerHour(UnitsNet.QuantityValue).
public static SpeedVector3 FromYardsPerHour(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromYardsPerMinute(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromYardsPerMinute(UnitsNet.QuantityValue).
public static SpeedVector3 FromYardsPerMinute(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
FromYardsPerSecond(double, double, double)
Creates a SpeedVector3 with all components created via UnitsNet.Speed.FromYardsPerSecond(UnitsNet.QuantityValue).
public static SpeedVector3 FromYardsPerSecond(double x, double y, double z)
Parameters
Returns
- SpeedVector3
A SpeedVector3 with all components in the corresponding unit.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
Lerp(SpeedVector3, SpeedVector3, double)
Linearly interpolates between two vectors.
The result at t = 0 is a; at t = 1 it is
b. Values of t outside [0, 1] extrapolate beyond the
endpoints — use LerpClamped(SpeedVector3, SpeedVector3, double) if you need the result bounded to the segment
between a and b.
public static SpeedVector3 Lerp(SpeedVector3 a, SpeedVector3 b, double t)
Parameters
aSpeedVector3The start vector (
t= 0).bSpeedVector3The end vector (
t= 1).tdoubleThe interpolation parameter. Values outside [0, 1] extrapolate.
Returns
- SpeedVector3
The interpolated SpeedVector3.
LerpClamped(SpeedVector3, SpeedVector3, double)
Linearly interpolates between two vectors, with t clamped to [0, 1].
public static SpeedVector3 LerpClamped(SpeedVector3 a, SpeedVector3 b, double t)
Parameters
aSpeedVector3The start vector (
t= 0).bSpeedVector3The end vector (
t= 1).tdoubleThe interpolation parameter, clamped to [0, 1].
Returns
- SpeedVector3
The interpolated SpeedVector3, always between
aandb.
Multiply(double)
Scales the vector by a scalar factor.
public SpeedVector3 Multiply(double scalar)
Parameters
scalardoubleThe scalar factor.
Returns
- SpeedVector3
The scaled vector.
Negate()
Negates all components.
public SpeedVector3 Negate()
Returns
- SpeedVector3
A vector with all components negated.
Normalize()
Returns a dimensionless unit vector pointing in the same direction. For a zero vector, Zero is returned.
public DoubleVector3 Normalize()
Returns
- DoubleVector3
A unit-length DoubleVector3 in the same direction.
Subtract(SpeedVector3)
Subtracts two vectors component-wise.
public SpeedVector3 Subtract(SpeedVector3 other)
Parameters
otherSpeedVector3The vector to subtract.
Returns
- SpeedVector3
The component-wise difference.
Operators
operator +(SpeedVector3, SpeedVector3)
Adds two vectors component-wise.
public static SpeedVector3 operator +(SpeedVector3 left, SpeedVector3 right)
Parameters
leftSpeedVector3The left operand.
rightSpeedVector3The right operand.
Returns
- SpeedVector3
The component-wise sum.
operator /(SpeedVector3, double)
Divides the vector by a scalar divisor.
public static SpeedVector3 operator /(SpeedVector3 left, double scalar)
Parameters
leftSpeedVector3The vector to divide.
scalardoubleThe scalar divisor.
Returns
- SpeedVector3
The divided vector.
operator /(SpeedVector3, Duration)
Divides a SpeedVector3 by a UnitsNet.Duration to produce a AccelerationVector3.
public static AccelerationVector3 operator /(SpeedVector3 left, Duration right)
Parameters
leftSpeedVector3The left operand.
rightDurationThe right operand.
Returns
operator *(double, SpeedVector3)
Scales the vector by a scalar factor. Operands may be supplied in either order.
public static SpeedVector3 operator *(double scalar, SpeedVector3 right)
Parameters
scalardoubleThe scalar factor.
rightSpeedVector3The vector to scale.
Returns
- SpeedVector3
The scaled vector.
operator *(SpeedVector3, double)
Scales the vector by a scalar factor.
public static SpeedVector3 operator *(SpeedVector3 left, double scalar)
Parameters
leftSpeedVector3The vector to scale.
scalardoubleThe scalar factor.
Returns
- SpeedVector3
The scaled vector.
operator *(SpeedVector3, Duration)
Multiplies a SpeedVector3 by a UnitsNet.Duration to produce a LengthVector3.
public static LengthVector3 operator *(SpeedVector3 left, Duration right)
Parameters
leftSpeedVector3The left operand.
rightDurationThe right operand.
Returns
operator *(SpeedVector3, Mass)
Multiplies a velocity vector by a mass to produce a momentum (impulse) vector (p = m·v) in 3D, preserving the caller's unit pair where possible.
The result unit is derived from the (SpeedUnit, MassUnit) pair: m/s × kg = kg·m/s, ft/s × slug = slug·ft/s, ft/s × lb = lb·ft/s. All other combinations fall back to N·s.
public static ImpulseVector3 operator *(SpeedVector3 left, Mass right)
Parameters
leftSpeedVector3The 3D velocity vector.
rightMassThe mass of the object.
Returns
- ImpulseVector3
The 3D momentum vector in the unit matching the (speed, mass) pair.
Examples
var velocity = new SpeedVector3(
Speed.FromMetersPerSecond(3), Speed.FromMetersPerSecond(4), Speed.Zero);
ImpulseVector3 momentum = velocity * Mass.FromKilograms(2); // (6 kg·m/s, 8 kg·m/s, 0)
operator *(Duration, SpeedVector3)
Multiplies a UnitsNet.Duration by a SpeedVector3 to produce a LengthVector3. Operands may be supplied in either order.
public static LengthVector3 operator *(Duration left, SpeedVector3 right)
Parameters
leftDurationThe left operand.
rightSpeedVector3The right operand.
Returns
operator *(Mass, SpeedVector3)
Multiplies a mass by a velocity vector to produce a momentum vector (p = m·v). Operands may be supplied in either order.
public static ImpulseVector3 operator *(Mass left, SpeedVector3 right)
Parameters
leftMassThe mass of the object.
rightSpeedVector3The 3D velocity vector.
Returns
- ImpulseVector3
The 3D momentum vector in the unit matching the (speed, mass) pair.
operator -(SpeedVector3, SpeedVector3)
Subtracts two vectors component-wise.
public static SpeedVector3 operator -(SpeedVector3 left, SpeedVector3 right)
Parameters
leftSpeedVector3The left operand.
rightSpeedVector3The right operand.
Returns
- SpeedVector3
The component-wise difference.
operator -(SpeedVector3)
Negates all components.
public static SpeedVector3 operator -(SpeedVector3 value)
Parameters
valueSpeedVector3The vector to negate.
Returns
- SpeedVector3
A vector with all components negated.