Thunder.UnitsNET.Vectors
0.2.10
See the version list below for details.
dotnet add package Thunder.UnitsNET.Vectors --version 0.2.10
NuGet\Install-Package Thunder.UnitsNET.Vectors -Version 0.2.10
<PackageReference Include="Thunder.UnitsNET.Vectors" Version="0.2.10" />
<PackageVersion Include="Thunder.UnitsNET.Vectors" Version="0.2.10" />
<PackageReference Include="Thunder.UnitsNET.Vectors" />
paket add Thunder.UnitsNET.Vectors --version 0.2.10
#r "nuget: Thunder.UnitsNET.Vectors, 0.2.10"
#:package Thunder.UnitsNET.Vectors@0.2.10
#addin nuget:?package=Thunder.UnitsNET.Vectors&version=0.2.10
#tool nuget:?package=Thunder.UnitsNET.Vectors&version=0.2.10
Thunder.UnitsNET.Vectors
A unit-aware 2D/3D vector library for physics-driven game loops. Component types come from UnitsNet, so every operation preserves physical units — LengthVector2 / Duration returns SpeedVector2, not a raw float.
Supported frameworks: net8.0, net10.0
Quick start
using Thunder.UnitsNET.Vectors;
using UnitsNet;
using UnitsNet.Units;
// Position
var position = new LengthVector2(
Length.FromMeters(3),
Length.FromMeters(4));
// Kinematics: displacement over time → velocity
SpeedVector2 velocity = position / Duration.FromSeconds(2);
// Dynamics: F = ma
var accel = new AccelerationVector2(
Acceleration.FromMetersPerSecondSquared(9.8),
Acceleration.FromMetersPerSecondSquared(0));
ForceVector2 force = accel * Mass.FromKilograms(5);
// Dot product: work = F · d (yields Energy)
Energy work = force.Dot(position);
// Normalize to a unit DoubleVector2 direction
DoubleVector2 dir = position.Normalize();
// Scalar magnitude
Length mag = position.Magnitude();
Kinematic operator chains
| Expression | Returns |
|---|---|
LengthVector2 / Duration |
SpeedVector2 |
SpeedVector2 / Duration |
AccelerationVector2 |
AccelerationVector2 / Duration |
JerkVector2 |
AccelerationVector2 * Mass |
ForceVector2 |
ForceVector2 * Duration |
ImpulseVector2 |
ForceVector2.Dot(LengthVector2) |
Energy |
ForceVector2.Dot(SpeedVector2) |
Power |
SpeedVector2.Dot(SpeedVector2) |
SpecificEnergy |
The same chains exist for all Vector3 variants.
Type inventory
2D types
| Type | Component unit | Notes |
|---|---|---|
DoubleVector2 |
double |
Dimensionless direction / normalised result |
LengthVector2 |
Length |
Position |
SpeedVector2 |
Speed |
Velocity |
AccelerationVector2 |
Acceleration |
Linear acceleration |
ForceVector2 |
Force |
Newtonian force |
JerkVector2 |
Jerk |
Rate of acceleration change |
ImpulseVector2 |
Impulse |
Momentum impulse |
MagneticFieldVector2 |
MagneticField |
|
MagnetizationVector2 |
Magnetization |
|
LinearDensityVector2 |
LinearDensity |
|
ElectricFieldVector2 |
ElectricField |
3D types
| Type | Component unit | Notes |
|---|---|---|
DoubleVector3 |
double |
Dimensionless |
LengthVector3 |
Length |
|
SpeedVector3 |
Speed |
|
AccelerationVector3 |
Acceleration |
|
ForceVector3 |
Force |
|
JerkVector3 |
Jerk |
|
ImpulseVector3 |
Impulse |
|
MagneticFieldVector3 |
MagneticField |
|
MagnetizationVector3 |
Magnetization |
|
MassFluxVector3 |
MassFlux |
|
ElectricFieldVector3 |
ElectricField |
|
ElectricCurrentDensityVector3 |
ElectricCurrentDensity |
|
TemperatureGradientVector3 |
TemperatureGradient |
Common API (all types)
| Member | Description |
|---|---|
X, Y (/ Z) |
Component accessors |
Zero |
Static zero vector |
Magnitude() |
Scalar Euclidean magnitude |
Normalize() |
Returns a DoubleVector2/DoubleVector3 unit vector |
Dot(other) |
Dot product; return type depends on the pair |
As(unit) |
Returns (double X, double Y) in the specified unit |
+, -, *, / |
Component-wise arithmetic |
==, != |
Value equality (record struct) |
ToString() |
Formatted component string |
Source repository
https://code.thundersizzle.tech/Thunder/thunder-unitsnet-vectors
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Thunder.UnitsNET.Vectors:
| Package | Downloads |
|---|---|
|
Thunder.UnitsNET.Vectors.MonoGame
MonoGame/XNA integration for Thunder.UnitsNET.Vectors. Converts unit-aware LengthVector2/Vector3 to XNA Vector2/Vector3 with explicit scale, keeping physics and rendering units separate. |
|
|
Thunder.UnitsNET.Vectors.Geometry
Unit-aware 2D geometry types built on Thunder.UnitsNET.Vectors. Shapes, directions, and spatial primitives for physics-driven game loops. |
|
|
Thunder.UnitsNET.Vectors.Geometry.MonoGame
MonoGame/XNA integration for Thunder.UnitsNET.Vectors.Geometry. Converts unit-aware 2D geometry shapes to XNA rendering primitives with explicit scale, keeping physics and rendering units separate. |
GitHub repositories
This package is not used by any popular GitHub repositories.