Thunder.UnitsNET.Vectors.Geometry
0.4.0-preview4
See the version list below for details.
dotnet add package Thunder.UnitsNET.Vectors.Geometry --version 0.4.0-preview4
NuGet\Install-Package Thunder.UnitsNET.Vectors.Geometry -Version 0.4.0-preview4
<PackageReference Include="Thunder.UnitsNET.Vectors.Geometry" Version="0.4.0-preview4" />
<PackageVersion Include="Thunder.UnitsNET.Vectors.Geometry" Version="0.4.0-preview4" />
<PackageReference Include="Thunder.UnitsNET.Vectors.Geometry" />
paket add Thunder.UnitsNET.Vectors.Geometry --version 0.4.0-preview4
#r "nuget: Thunder.UnitsNET.Vectors.Geometry, 0.4.0-preview4"
#:package Thunder.UnitsNET.Vectors.Geometry@0.4.0-preview4
#addin nuget:?package=Thunder.UnitsNET.Vectors.Geometry&version=0.4.0-preview4&prerelease
#tool nuget:?package=Thunder.UnitsNET.Vectors.Geometry&version=0.4.0-preview4&prerelease
Thunder.UnitsNET.Vectors.Geometry
Unit-aware 2D geometry library built on Thunder.UnitsNET.Vectors. Shapes, directions, and spatial primitives where all distances are Length, all areas are Area, and all angles are Angle — dimensional errors in geometric code are impossible by construction.
Supported frameworks: net8.0, net10.0
Quick start
// dotnet add package Thunder.UnitsNET.Vectors.Geometry
using Thunder.UnitsNET.Vectors.Geometry;
using UnitsNet;
// Circle
var circle = new Circle2(LengthPoint2.FromMeters(0, 0), Radius.FromMeters(5));
bool hit = circle.Contains(LengthPoint2.FromMeters(3, 4)); // true
// Direction2 — a unit-magnitude direction
var dir = Direction2.FromDegrees(45); // North-East
var rotated = dir.Rotate(Angle.FromDegrees(90)); // North-West (135°)
// Arc
var arc = new Arc2(circle, Direction2.East, Angle.FromDegrees(90));
Length arcLen = arc.ArcLength; // π/2 × 5 m ≈ 7.85 m
// Polygon
var hex = Polygon2.CreateRegular(LengthPoint2.Origin, Length.FromMeters(1), 6);
Area hexArea = hex.Area;
Primitive types
| Type | Description |
|---|---|
Direction2 |
Unit-magnitude direction with rotation, compass constants, and angle helpers |
Transform2 |
2D coordinate frame: position + rotation (Direction2) + scale (Ratio) |
Circle2 |
Centre + radius; containment, tangent lines, point-on-circle |
Rectangle2 |
Centre + dimensions + rotation; corners, area, perimeter |
Triangle2 |
Three vertices; area (signed shoelace), centroid, containment |
Ellipse2 |
Centre + semi-axes + rotation; area, perimeter (Ramanujan) |
Arc2 |
Circle + start direction + signed sweep; arc length, polyline |
Sector2 |
Circle + two radial edges + direction; area, containment |
Capsule2 |
Two spine endpoints + radius; area, closest-point containment |
Polygon2 |
N-vertex polygon; area, centroid, convexity, ray-cast containment |
LengthSegment2 |
Two endpoints; length, direction, closest-point projection |
LengthLine2 |
Infinite line through a point + direction |
LengthRay2 |
Half-line from origin in a direction |
MonoGame integration
Add Thunder.UnitsNET.Vectors.Geometry.MonoGame to convert geometry types to XNA rendering primitives.
Packages in this family
| 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. |
-
net10.0
- Thunder.UnitsNET.Vectors (>= 0.4.0-preview4)
- UnitsNet (>= 5.67.0)
-
net8.0
- Thunder.UnitsNET.Vectors (>= 0.4.0-preview4)
- UnitsNet (>= 5.67.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Thunder.UnitsNET.Vectors.Geometry:
| Package | Downloads |
|---|---|
|
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.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.7.0 | 114 | 5/5/2026 |
| 0.7.0-preview37 | 105 | 5/5/2026 |
| 0.7.0-preview36 | 97 | 5/5/2026 |
| 0.7.0-preview35 | 99 | 5/4/2026 |
| 0.6.0-preview34 | 116 | 4/28/2026 |
| 0.6.0-preview33 | 109 | 4/27/2026 |
| 0.6.0-preview32 | 114 | 4/27/2026 |
| 0.5.0 | 123 | 4/23/2026 |
| 0.5.0-preview31 | 106 | 4/28/2026 |
| 0.5.0-preview30 | 125 | 4/28/2026 |
| 0.5.0-preview29 | 112 | 4/28/2026 |
| 0.5.0-preview28 | 113 | 4/28/2026 |
| 0.5.0-preview27 | 111 | 4/28/2026 |
| 0.4.0 | 135 | 4/22/2026 |
| 0.4.0-preview6 | 119 | 4/20/2026 |
| 0.4.0-preview5 | 107 | 4/20/2026 |
| 0.4.0-preview4 | 115 | 4/20/2026 |
| 0.4.0-preview25 | 97 | 4/20/2026 |
| 0.4.0-preview24 | 112 | 4/20/2026 |
| 0.4.0-preview23.1 | 53 | 4/20/2026 |