Namespace Thunder.UnitsNET.Vectors
Structs
- AccelerationVector2
A 2D vector whose components represent acceleration, each expressed as an UnitsNet.Acceleration (e.g. metres per second squared).
Acceleration describes how quickly velocity is changing. In a game loop you often accumulate acceleration from forces (a = F / m) and integrate it over a time step to update velocity. It sits between JerkVector2 (rate of change of acceleration) and SpeedVector2 in the kinematics chain.
A common example is gravity: (0 m/s², −9.81 m/s²) pulls everything downward at 9.81 m/s² in the negative-Y direction. After 1 second, it adds −9.81 m/s to the Y component of velocity.
- AccelerationVector3
A 3D vector whose components represent acceleration, each expressed as a UnitsNet.Acceleration.
- AreaVector2
A 2D vector whose components represent area, each expressed as an UnitsNet.Area (e.g. square metres, square feet).
This type arises from operations such as the dot product of two LengthVector2 instances — it carries units-squared rather than a plain double, preserving dimensional safety across the calculation.
- DoubleVector2
A double-precision 2D vector with dimensionless components — the foundation for all direction and unit-vector arithmetic in this library.
Unlike the unit-aware vector types (e.g. LengthVector2, SpeedVector2), DoubleVector2 carries no physical unit. It is used for:
- Unit direction vectors returned by Normalize() and similar methods — these have magnitude 1 and no unit.
- Projections and dot products where a dimensionless coefficient is needed.
- Intermediate results in geometry calculations (e.g. ray directions in
Thunder.UnitsNET.Vectors.Geometry).
Positive X points right; positive Y points up (standard mathematical convention).
- DoubleVector3
A double-precision 3D vector with dimensionless components — the foundation for all direction and unit-vector arithmetic in three dimensions.
Unlike the unit-aware vector types (e.g. LengthVector3, SpeedVector3), DoubleVector3 carries no physical unit. It is used for:
- Unit direction vectors returned by Normalize() and similar methods — these have magnitude 1 and no unit.
- Surface normals, ray directions, and other pure geometric directions in 3D rendering and physics engines.
- Intermediate results in 3D geometry calculations such as cross products, projections, and rotation axes.
Positive X points right, positive Y points up, and positive Z points toward the viewer (right-handed coordinate system). Cross products follow the right-hand rule.
- ElectricCurrentDensityVector3
A 3D vector whose components represent electriccurrentdensity, each expressed as a UnitsNet.ElectricCurrentDensity.
- ElectricFieldVector2
A 2D vector whose components represent an electric field, each expressed as an UnitsNet.ElectricField (e.g. volts per metre).
- ElectricFieldVector3
A 3D vector whose components represent electricfield, each expressed as a UnitsNet.ElectricField.
- ForceVector2
A 2D vector whose components represent force, each expressed as a UnitsNet.Force (e.g. newtons, kilonewtons).
Force describes a push or pull applied to a body. In Newton's second law (F = m·a), dividing a force vector by a UnitsNet.Mass gives an AccelerationVector2. The dot product of a force vector with a displacement vector gives the work done (energy transferred).
- ForceVector3
A 3D vector whose components represent force, each expressed as a UnitsNet.Force.
- ImpulseVector2
A 2D vector whose components represent impulse, each expressed as an UnitsNet.Impulse (e.g. newton-seconds).
Impulse is the product of force and time (J = F·Δt). It equals the change in momentum of an object, making it useful for modelling collisions and sudden force applications in physics simulations.
- ImpulseVector3
A 3D vector whose components represent impulse, each expressed as a UnitsNet.Impulse.
- 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.
- JerkVector3
A 3D vector whose components represent jerk, each expressed as a UnitsNet.Jerk.
- LengthPoint2
A 2D point whose components represent a position in length-unit space, each expressed as a UnitsNet.Length (e.g. metres, feet, kilometres).
Use this type to represent where something is — a world-space coordinate, a shape vertex, a contact point. It is intentionally distinct from LengthVector2, which represents a displacement (how far something has moved). This distinction prevents accidental arithmetic that would produce nonsensical results, such as adding two positions together.
Allowed algebra:
LengthPoint2 + LengthVector2 → LengthPoint2(translate a point)LengthPoint2 - LengthVector2 → LengthPoint2(reverse translate)LengthPoint2 - LengthPoint2 → LengthVector2(displacement between points)
To convert between types explicitly, use ToVector() or ToPoint().
- LengthVector2
A 2D vector whose components represent a displacement or position, each expressed as a UnitsNet.Length (e.g. metres, feet, kilometres).
Use this type whenever you need to track where something is on a 2D plane, or how far it has moved. It is the central type in the kinematics chain: dividing by a UnitsNet.Duration gives a SpeedVector2; multiplying by a UnitsNet.Length gives an AreaVector2.
The positive X-axis points right and the positive Y-axis points up (standard mathematical convention). Both components always carry their unit, so there is no ambiguity about whether a value is in metres, feet, or any other length unit.
- LengthVector3
A 3D vector whose components represent length, each expressed as a UnitsNet.Length.
- LinearDensityVector2
A 2D vector whose components represent linear density, each expressed as a UnitsNet.LinearDensity (e.g. kilograms per metre).
- MagneticFieldVector2
A 2D vector whose components represent a magnetic field, each expressed as a UnitsNet.MagneticField (e.g. tesla).
- MagneticFieldVector3
A 3D vector whose components represent magneticfield, each expressed as a UnitsNet.MagneticField.
- MagnetizationVector2
A 2D vector whose components represent magnetization, each expressed as a UnitsNet.Magnetization (e.g. amperes per metre).
- MagnetizationVector3
A 3D vector whose components represent magnetization, each expressed as a UnitsNet.Magnetization.
- MassFluxVector3
A 3D vector whose components represent massflux, each expressed as a UnitsNet.MassFlux.
- RotationalAccelerationVector3
A 3D vector whose components represent angular acceleration, each expressed as a UnitsNet.RotationalAcceleration.
Angular acceleration describes how quickly angular velocity changes in 3D space. It is produced by
TorqueVector3 / MassMomentOfInertiaand integrates into a RotationalSpeedVector3 when multiplied by a UnitsNet.Duration.
- RotationalSpeedVector3
A 3D vector whose components represent angular velocity (rotational speed), each expressed as a UnitsNet.RotationalSpeed.
In 3D rigid-body physics, angular velocity is a vector: its direction is the instantaneous rotation axis (right-hand rule) and its magnitude is the spin rate. This is produced by integrating a RotationalAccelerationVector3 over time:
RotationalAccelerationVector3 × Duration = RotationalSpeedVector3.
- SpeedVector2
A 2D vector whose components represent velocity, each expressed as a UnitsNet.Speed (e.g. metres per second, kilometres per hour).
Velocity tells you how fast something is moving and in what direction. It sits in the middle of the kinematics chain: it is produced by multiplying an AccelerationVector2 by a UnitsNet.Duration (v = a·t), or by dividing a LengthVector2 by a UnitsNet.Duration (v = Δx / Δt). Multiplying by another UnitsNet.Duration gives displacement; dividing by a UnitsNet.Duration gives AccelerationVector2.
Each component is independent: a velocity of (3 m/s, 4 m/s) means 3 m/s rightward and 4 m/s upward at the same time, giving a total speed of 5 m/s.
- SpeedVector3
A 3D vector whose components represent speed, each expressed as a UnitsNet.Speed.
- TemperatureGradientVector3
A 3D vector whose components represent temperaturegradient, each expressed as a UnitsNet.TemperatureGradient.
- TorqueVector3
A 3D vector whose components represent torque, each expressed as a UnitsNet.Torque.
In 3D rigid-body physics, torque is a vector: its direction is the rotation axis (by the right-hand rule) and its magnitude is the rotational force. Use this type when applying angular forces in 3D simulation — dividing by a UnitsNet.MassMomentOfInertia yields a RotationalAccelerationVector3.