Struct JerkVector2
A 2D vector whose components represent jerk (rate of change of acceleration), each expressed as a UnitsNet.Jerk (e.g. metres per second cubed).
Jerk is the derivative of acceleration with respect to time. It appears in smooth motion profiles and physical simulations that model forces changing over time rather than being applied instantaneously.
public readonly record struct JerkVector2 : IEquatable<JerkVector2>
- Implements
- Inherited Members
- Extension Methods
Examples
var jerk = new JerkVector2(Jerk.FromMetersPerSecondCubed(1), Jerk.Zero);
AccelerationVector2 da = jerk * Duration.FromSeconds(0.1); // acceleration change per step
Constructors
JerkVector2(Jerk, Jerk)
Constructs a JerkVector2 from two UnitsNet.Jerk components.
public JerkVector2(Jerk x, Jerk y)
Parameters
xJerkThe X component.
yJerkThe Y component.
Properties
Magnitude
Returns the Euclidean magnitude of this vector as a UnitsNet.Jerk. The result is expressed in the same unit as the X component.
public Jerk Magnitude { get; }
Property Value
- Jerk
X
The X component.
public Jerk X { get; }
Property Value
- Jerk
Y
The Y component.
public Jerk Y { get; }
Property Value
- Jerk
Zero
A JerkVector2 with both components set to zero.
public static JerkVector2 Zero { get; }
Property Value
Methods
Abs()
Returns a vector with each component replaced by its absolute value.
public JerkVector2 Abs()
Returns
- JerkVector2
A JerkVector2 with non-negative components.
Add(JerkVector2)
Adds two vectors component-wise.
public JerkVector2 Add(JerkVector2 other)
Parameters
otherJerkVector2The vector to add.
Returns
- JerkVector2
The component-wise sum.
ApproximatelyEquals(JerkVector2, Jerk)
Returns true if each component of this vector is within
tolerance of the corresponding component of other.
public bool ApproximatelyEquals(JerkVector2 other, Jerk tolerance)
Parameters
otherJerkVector2The vector to compare against.
toleranceJerkThe maximum allowed difference per component (inclusive).
Returns
As(JerkUnit)
Projects both components into the requested unit, returning a unit-less DoubleVector2.
public DoubleVector2 As(JerkUnit unit)
Parameters
unitJerkUnitThe target unit for each component.
Returns
- DoubleVector2
A DoubleVector2 with components expressed in
unit.
AsDefault()
Returns both components expressed in the SI base unit as a DoubleVector2.
public DoubleVector2 AsDefault()
Returns
- DoubleVector2
A DoubleVector2 with components in the default SI unit.
Clamp(JerkVector2, JerkVector2)
Returns a vector with each component clamped to the range [min, max].
public JerkVector2 Clamp(JerkVector2 min, JerkVector2 max)
Parameters
minJerkVector2The lower bound vector (inclusive, per component).
maxJerkVector2The upper bound vector (inclusive, per component).
Returns
- JerkVector2
A JerkVector2 with each component in [min, max].
Divide(double)
Divides the vector by a scalar divisor.
public JerkVector2 Divide(double scalar)
Parameters
scalardoubleThe scalar divisor.
Returns
- JerkVector2
The divided vector.
Equals(JerkVector2)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(JerkVector2 other)
Parameters
otherJerkVector2An object to compare with this object.
Returns
FromCentimetersPerSecondCubed(double, double)
Creates a JerkVector2 with both components created via UnitsNet.Jerk.FromCentimetersPerSecondCubed(UnitsNet.QuantityValue).
public static JerkVector2 FromCentimetersPerSecondCubed(double x, double y)
Parameters
Returns
- JerkVector2
A JerkVector2 with both components in the corresponding unit.
FromDecimetersPerSecondCubed(double, double)
Creates a JerkVector2 with both components created via UnitsNet.Jerk.FromDecimetersPerSecondCubed(UnitsNet.QuantityValue).
public static JerkVector2 FromDecimetersPerSecondCubed(double x, double y)
Parameters
Returns
- JerkVector2
A JerkVector2 with both components in the corresponding unit.
FromFeetPerSecondCubed(double, double)
Creates a JerkVector2 with both components created via UnitsNet.Jerk.FromFeetPerSecondCubed(UnitsNet.QuantityValue).
public static JerkVector2 FromFeetPerSecondCubed(double x, double y)
Parameters
Returns
- JerkVector2
A JerkVector2 with both components in the corresponding unit.
FromInchesPerSecondCubed(double, double)
Creates a JerkVector2 with both components created via UnitsNet.Jerk.FromInchesPerSecondCubed(UnitsNet.QuantityValue).
public static JerkVector2 FromInchesPerSecondCubed(double x, double y)
Parameters
Returns
- JerkVector2
A JerkVector2 with both components in the corresponding unit.
FromKilometersPerSecondCubed(double, double)
Creates a JerkVector2 with both components created via UnitsNet.Jerk.FromKilometersPerSecondCubed(UnitsNet.QuantityValue).
public static JerkVector2 FromKilometersPerSecondCubed(double x, double y)
Parameters
Returns
- JerkVector2
A JerkVector2 with both components in the corresponding unit.
FromMetersPerSecondCubed(double, double)
Creates a JerkVector2 with both components created via UnitsNet.Jerk.FromMetersPerSecondCubed(UnitsNet.QuantityValue).
public static JerkVector2 FromMetersPerSecondCubed(double x, double y)
Parameters
Returns
- JerkVector2
A JerkVector2 with both components in the corresponding unit.
FromMicrometersPerSecondCubed(double, double)
Creates a JerkVector2 with both components created via UnitsNet.Jerk.FromMicrometersPerSecondCubed(UnitsNet.QuantityValue).
public static JerkVector2 FromMicrometersPerSecondCubed(double x, double y)
Parameters
Returns
- JerkVector2
A JerkVector2 with both components in the corresponding unit.
FromMillimetersPerSecondCubed(double, double)
Creates a JerkVector2 with both components created via UnitsNet.Jerk.FromMillimetersPerSecondCubed(UnitsNet.QuantityValue).
public static JerkVector2 FromMillimetersPerSecondCubed(double x, double y)
Parameters
Returns
- JerkVector2
A JerkVector2 with both components in the corresponding unit.
FromMillistandardGravitiesPerSecond(double, double)
Creates a JerkVector2 with both components created via UnitsNet.Jerk.FromMillistandardGravitiesPerSecond(UnitsNet.QuantityValue).
public static JerkVector2 FromMillistandardGravitiesPerSecond(double x, double y)
Parameters
Returns
- JerkVector2
A JerkVector2 with both components in the corresponding unit.
FromNanometersPerSecondCubed(double, double)
Creates a JerkVector2 with both components created via UnitsNet.Jerk.FromNanometersPerSecondCubed(UnitsNet.QuantityValue).
public static JerkVector2 FromNanometersPerSecondCubed(double x, double y)
Parameters
Returns
- JerkVector2
A JerkVector2 with both components in the corresponding unit.
FromStandardGravitiesPerSecond(double, double)
Creates a JerkVector2 with both components created via UnitsNet.Jerk.FromStandardGravitiesPerSecond(UnitsNet.QuantityValue).
public static JerkVector2 FromStandardGravitiesPerSecond(double x, double y)
Parameters
Returns
- JerkVector2
A JerkVector2 with both 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(JerkVector2, JerkVector2, 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(JerkVector2, JerkVector2, double) if you need the result bounded to the segment
between a and b.
public static JerkVector2 Lerp(JerkVector2 a, JerkVector2 b, double t)
Parameters
aJerkVector2The start vector (
t= 0).bJerkVector2The end vector (
t= 1).tdoubleThe interpolation parameter. Values outside [0, 1] extrapolate.
Returns
- JerkVector2
The interpolated JerkVector2.
LerpClamped(JerkVector2, JerkVector2, double)
Linearly interpolates between two vectors, with t clamped to [0, 1].
public static JerkVector2 LerpClamped(JerkVector2 a, JerkVector2 b, double t)
Parameters
aJerkVector2The start vector (
t= 0).bJerkVector2The end vector (
t= 1).tdoubleThe interpolation parameter, clamped to [0, 1].
Returns
- JerkVector2
The interpolated JerkVector2, always between
aandb.
Multiply(double)
Scales the vector by a scalar factor.
public JerkVector2 Multiply(double scalar)
Parameters
scalardoubleThe scalar factor.
Returns
- JerkVector2
The scaled vector.
Negate()
Negates both components.
public JerkVector2 Negate()
Returns
- JerkVector2
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 DoubleVector2 Normalize()
Returns
- DoubleVector2
A unit-length DoubleVector2 in the same direction.
Subtract(JerkVector2)
Subtracts two vectors component-wise.
public JerkVector2 Subtract(JerkVector2 other)
Parameters
otherJerkVector2The vector to subtract.
Returns
- JerkVector2
The component-wise difference.
Operators
operator +(JerkVector2, JerkVector2)
Adds two vectors component-wise.
public static JerkVector2 operator +(JerkVector2 left, JerkVector2 right)
Parameters
leftJerkVector2The left operand.
rightJerkVector2The right operand.
Returns
- JerkVector2
The component-wise sum.
operator /(JerkVector2, double)
Divides the vector by a scalar divisor.
public static JerkVector2 operator /(JerkVector2 left, double scalar)
Parameters
leftJerkVector2The vector to divide.
scalardoubleThe scalar divisor.
Returns
- JerkVector2
The divided vector.
operator *(double, JerkVector2)
Scales the vector by a scalar factor. Operands may be supplied in either order.
public static JerkVector2 operator *(double scalar, JerkVector2 right)
Parameters
scalardoubleThe scalar factor.
rightJerkVector2The vector to scale.
Returns
- JerkVector2
The scaled vector.
operator *(JerkVector2, double)
Scales the vector by a scalar factor.
public static JerkVector2 operator *(JerkVector2 left, double scalar)
Parameters
leftJerkVector2The vector to scale.
scalardoubleThe scalar factor.
Returns
- JerkVector2
The scaled vector.
operator *(JerkVector2, Duration)
Multiplies a jerk vector by a duration to produce an acceleration change (Δa = j·t), preserving the caller's unit.
Jerk is the rate of change of acceleration. Multiplying by time tells you how much
the acceleration will have changed after right seconds of constant
jerk. The result unit is derived from the jerk component unit (e.g. ft/s³ → ft/s²).
Jerk is important in trajectory planning and ride-quality analysis — a smooth motion profile limits jerk to avoid mechanical shock or passenger discomfort.
public static AccelerationVector2 operator *(JerkVector2 left, Duration right)
Parameters
leftJerkVector2The jerk vector (rate of change of acceleration).
rightDurationThe elapsed time.
Returns
- AccelerationVector2
The change in acceleration vector (Δa) in the unit matching the jerk component unit.
Examples
// A jerk of 2 m/s³ applied for 3 seconds increases acceleration by 6 m/s²
var jerk = new JerkVector2(Jerk.FromMetersPerSecondCubed(2), Jerk.Zero);
AccelerationVector2 deltaA = jerk * Duration.FromSeconds(3); // (6 m/s², 0)
// Unit-preserving: ft/s³ × s = ft/s²
var jerkFt = new JerkVector2(Jerk.From(2, JerkUnit.FootPerSecondCubed), Jerk.Zero);
AccelerationVector2 deltaAFt = jerkFt * Duration.FromSeconds(3); // (6 ft/s², 0)
operator *(Duration, JerkVector2)
Multiplies a duration by a jerk vector to produce an acceleration change (Δa = j·t). Operands may be supplied in either order.
public static AccelerationVector2 operator *(Duration left, JerkVector2 right)
Parameters
leftDurationThe elapsed time.
rightJerkVector2The jerk vector.
Returns
- AccelerationVector2
The change in acceleration vector (Δa) in the unit matching the jerk component unit.
Examples
AccelerationVector2 deltaA = Duration.FromSeconds(3) * new JerkVector2(
Jerk.FromMetersPerSecondCubed(2), Jerk.Zero); // (6 m/s², 0)
operator -(JerkVector2, JerkVector2)
Subtracts two vectors component-wise.
public static JerkVector2 operator -(JerkVector2 left, JerkVector2 right)
Parameters
leftJerkVector2The left operand.
rightJerkVector2The right operand.
Returns
- JerkVector2
The component-wise difference.
operator -(JerkVector2)
Negates both components.
public static JerkVector2 operator -(JerkVector2 value)
Parameters
valueJerkVector2The vector to negate.
Returns
- JerkVector2
A vector with all components negated.