Struct ImpulseVector3
A 3D vector whose components represent impulse, each expressed as a UnitsNet.Impulse.
public readonly record struct ImpulseVector3 : IEquatable<ImpulseVector3>
- Implements
- Inherited Members
- Extension Methods
Constructors
ImpulseVector3(Impulse, Impulse, Impulse)
Constructs a ImpulseVector3 from three UnitsNet.Impulse components.
public ImpulseVector3(Impulse x, Impulse y, Impulse z)
Parameters
xImpulseThe X component.
yImpulseThe Y component.
zImpulseThe Z component.
Properties
Magnitude
Returns the Euclidean magnitude of this vector as a UnitsNet.Impulse. The result is expressed in the same unit as the X component.
public Impulse Magnitude { get; }
Property Value
- Impulse
X
The X component.
public Impulse X { get; }
Property Value
- Impulse
Y
The Y component.
public Impulse Y { get; }
Property Value
- Impulse
Z
The Z component.
public Impulse Z { get; }
Property Value
- Impulse
Zero
A ImpulseVector3 with all components set to zero.
public static ImpulseVector3 Zero { get; }
Property Value
Methods
Abs()
Returns a vector with each component replaced by its absolute value.
public ImpulseVector3 Abs()
Returns
- ImpulseVector3
A ImpulseVector3 with non-negative components.
Add(ImpulseVector3)
Adds two vectors component-wise.
public ImpulseVector3 Add(ImpulseVector3 other)
Parameters
otherImpulseVector3The vector to add.
Returns
- ImpulseVector3
The component-wise sum.
ApproximatelyEquals(ImpulseVector3, Impulse)
Returns true if each component of this vector is within
tolerance of the corresponding component of other.
public bool ApproximatelyEquals(ImpulseVector3 other, Impulse tolerance)
Parameters
otherImpulseVector3The vector to compare against.
toleranceImpulseThe maximum allowed difference per component (inclusive).
Returns
- bool
true when |X - other.X| <= tolerance, |Y - other.Y| <= tolerance, and |Z - other.Z| <= tolerance.
As(ImpulseUnit)
Projects all three components into the requested unit, returning a unit-less DoubleVector3.
public DoubleVector3 As(ImpulseUnit unit)
Parameters
unitImpulseUnitThe 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(ImpulseVector3, ImpulseVector3)
Returns a vector with each component clamped to the range [min, max].
public ImpulseVector3 Clamp(ImpulseVector3 min, ImpulseVector3 max)
Parameters
minImpulseVector3The lower bound vector (inclusive, per component).
maxImpulseVector3The upper bound vector (inclusive, per component).
Returns
- ImpulseVector3
A ImpulseVector3 with each component in [min, max].
Divide(double)
Divides the vector by a scalar divisor.
public ImpulseVector3 Divide(double scalar)
Parameters
scalardoubleThe scalar divisor.
Returns
- ImpulseVector3
The divided vector.
Equals(ImpulseVector3)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(ImpulseVector3 other)
Parameters
otherImpulseVector3An object to compare with this object.
Returns
FromCentinewtonSeconds(double, double, double)
Creates a ImpulseVector3 with all components created via UnitsNet.Impulse.FromCentinewtonSeconds(UnitsNet.QuantityValue).
public static ImpulseVector3 FromCentinewtonSeconds(double x, double y, double z)
Parameters
Returns
- ImpulseVector3
A ImpulseVector3 with all components in the corresponding unit.
FromDecanewtonSeconds(double, double, double)
Creates a ImpulseVector3 with all components created via UnitsNet.Impulse.FromDecanewtonSeconds(UnitsNet.QuantityValue).
public static ImpulseVector3 FromDecanewtonSeconds(double x, double y, double z)
Parameters
Returns
- ImpulseVector3
A ImpulseVector3 with all components in the corresponding unit.
FromDecinewtonSeconds(double, double, double)
Creates a ImpulseVector3 with all components created via UnitsNet.Impulse.FromDecinewtonSeconds(UnitsNet.QuantityValue).
public static ImpulseVector3 FromDecinewtonSeconds(double x, double y, double z)
Parameters
Returns
- ImpulseVector3
A ImpulseVector3 with all components in the corresponding unit.
FromKilogramMetersPerSecond(double, double, double)
Creates a ImpulseVector3 with all components created via UnitsNet.Impulse.FromKilogramMetersPerSecond(UnitsNet.QuantityValue).
public static ImpulseVector3 FromKilogramMetersPerSecond(double x, double y, double z)
Parameters
Returns
- ImpulseVector3
A ImpulseVector3 with all components in the corresponding unit.
FromKilonewtonSeconds(double, double, double)
Creates a ImpulseVector3 with all components created via UnitsNet.Impulse.FromKilonewtonSeconds(UnitsNet.QuantityValue).
public static ImpulseVector3 FromKilonewtonSeconds(double x, double y, double z)
Parameters
Returns
- ImpulseVector3
A ImpulseVector3 with all components in the corresponding unit.
FromMeganewtonSeconds(double, double, double)
Creates a ImpulseVector3 with all components created via UnitsNet.Impulse.FromMeganewtonSeconds(UnitsNet.QuantityValue).
public static ImpulseVector3 FromMeganewtonSeconds(double x, double y, double z)
Parameters
Returns
- ImpulseVector3
A ImpulseVector3 with all components in the corresponding unit.
FromMicronewtonSeconds(double, double, double)
Creates a ImpulseVector3 with all components created via UnitsNet.Impulse.FromMicronewtonSeconds(UnitsNet.QuantityValue).
public static ImpulseVector3 FromMicronewtonSeconds(double x, double y, double z)
Parameters
Returns
- ImpulseVector3
A ImpulseVector3 with all components in the corresponding unit.
FromMillinewtonSeconds(double, double, double)
Creates a ImpulseVector3 with all components created via UnitsNet.Impulse.FromMillinewtonSeconds(UnitsNet.QuantityValue).
public static ImpulseVector3 FromMillinewtonSeconds(double x, double y, double z)
Parameters
Returns
- ImpulseVector3
A ImpulseVector3 with all components in the corresponding unit.
FromNanonewtonSeconds(double, double, double)
Creates a ImpulseVector3 with all components created via UnitsNet.Impulse.FromNanonewtonSeconds(UnitsNet.QuantityValue).
public static ImpulseVector3 FromNanonewtonSeconds(double x, double y, double z)
Parameters
Returns
- ImpulseVector3
A ImpulseVector3 with all components in the corresponding unit.
FromNewtonSeconds(double, double, double)
Creates a ImpulseVector3 with all components created via UnitsNet.Impulse.FromNewtonSeconds(UnitsNet.QuantityValue).
public static ImpulseVector3 FromNewtonSeconds(double x, double y, double z)
Parameters
Returns
- ImpulseVector3
A ImpulseVector3 with all components in the corresponding unit.
FromPoundFeetPerSecond(double, double, double)
Creates a ImpulseVector3 with all components created via UnitsNet.Impulse.FromPoundFeetPerSecond(UnitsNet.QuantityValue).
public static ImpulseVector3 FromPoundFeetPerSecond(double x, double y, double z)
Parameters
Returns
- ImpulseVector3
A ImpulseVector3 with all components in the corresponding unit.
FromPoundForceSeconds(double, double, double)
Creates a ImpulseVector3 with all components created via UnitsNet.Impulse.FromPoundForceSeconds(UnitsNet.QuantityValue).
public static ImpulseVector3 FromPoundForceSeconds(double x, double y, double z)
Parameters
Returns
- ImpulseVector3
A ImpulseVector3 with all components in the corresponding unit.
FromSlugFeetPerSecond(double, double, double)
Creates a ImpulseVector3 with all components created via UnitsNet.Impulse.FromSlugFeetPerSecond(UnitsNet.QuantityValue).
public static ImpulseVector3 FromSlugFeetPerSecond(double x, double y, double z)
Parameters
Returns
- ImpulseVector3
A ImpulseVector3 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(ImpulseVector3, ImpulseVector3, 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(ImpulseVector3, ImpulseVector3, double) if you need the result bounded to the segment
between a and b.
public static ImpulseVector3 Lerp(ImpulseVector3 a, ImpulseVector3 b, double t)
Parameters
aImpulseVector3The start vector (
t= 0).bImpulseVector3The end vector (
t= 1).tdoubleThe interpolation parameter. Values outside [0, 1] extrapolate.
Returns
- ImpulseVector3
The interpolated ImpulseVector3.
LerpClamped(ImpulseVector3, ImpulseVector3, double)
Linearly interpolates between two vectors, with t clamped to [0, 1].
public static ImpulseVector3 LerpClamped(ImpulseVector3 a, ImpulseVector3 b, double t)
Parameters
aImpulseVector3The start vector (
t= 0).bImpulseVector3The end vector (
t= 1).tdoubleThe interpolation parameter, clamped to [0, 1].
Returns
- ImpulseVector3
The interpolated ImpulseVector3, always between
aandb.
Multiply(double)
Scales the vector by a scalar factor.
public ImpulseVector3 Multiply(double scalar)
Parameters
scalardoubleThe scalar factor.
Returns
- ImpulseVector3
The scaled vector.
Negate()
Negates all components.
public ImpulseVector3 Negate()
Returns
- ImpulseVector3
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(ImpulseVector3)
Subtracts two vectors component-wise.
public ImpulseVector3 Subtract(ImpulseVector3 other)
Parameters
otherImpulseVector3The vector to subtract.
Returns
- ImpulseVector3
The component-wise difference.
Operators
operator +(ImpulseVector3, ImpulseVector3)
Adds two vectors component-wise.
public static ImpulseVector3 operator +(ImpulseVector3 left, ImpulseVector3 right)
Parameters
leftImpulseVector3The left operand.
rightImpulseVector3The right operand.
Returns
- ImpulseVector3
The component-wise sum.
operator /(ImpulseVector3, double)
Divides the vector by a scalar divisor.
public static ImpulseVector3 operator /(ImpulseVector3 left, double scalar)
Parameters
leftImpulseVector3The vector to divide.
scalardoubleThe scalar divisor.
Returns
- ImpulseVector3
The divided vector.
operator *(double, ImpulseVector3)
Scales the vector by a scalar factor. Operands may be supplied in either order.
public static ImpulseVector3 operator *(double scalar, ImpulseVector3 right)
Parameters
scalardoubleThe scalar factor.
rightImpulseVector3The vector to scale.
Returns
- ImpulseVector3
The scaled vector.
operator *(ImpulseVector3, double)
Scales the vector by a scalar factor.
public static ImpulseVector3 operator *(ImpulseVector3 left, double scalar)
Parameters
leftImpulseVector3The vector to scale.
scalardoubleThe scalar factor.
Returns
- ImpulseVector3
The scaled vector.
operator -(ImpulseVector3, ImpulseVector3)
Subtracts two vectors component-wise.
public static ImpulseVector3 operator -(ImpulseVector3 left, ImpulseVector3 right)
Parameters
leftImpulseVector3The left operand.
rightImpulseVector3The right operand.
Returns
- ImpulseVector3
The component-wise difference.
operator -(ImpulseVector3)
Negates all components.
public static ImpulseVector3 operator -(ImpulseVector3 value)
Parameters
valueImpulseVector3The vector to negate.
Returns
- ImpulseVector3
A vector with all components negated.