Thunder.UnitsNET.Vectors.Geometry 0.2.0

dotnet add package Thunder.UnitsNET.Vectors.Geometry --version 0.2.0
                    
NuGet\Install-Package Thunder.UnitsNET.Vectors.Geometry -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Thunder.UnitsNET.Vectors.Geometry" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Thunder.UnitsNET.Vectors.Geometry" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Thunder.UnitsNET.Vectors.Geometry" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Thunder.UnitsNET.Vectors.Geometry --version 0.2.0
                    
#r "nuget: Thunder.UnitsNET.Vectors.Geometry, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Thunder.UnitsNET.Vectors.Geometry@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Thunder.UnitsNET.Vectors.Geometry&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Thunder.UnitsNET.Vectors.Geometry&version=0.2.0
                    
Install as a Cake Tool

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.

Quick start

// dotnet add package Thunder.UnitsNET.Vectors.Geometry

using Thunder.UnitsNET.Vectors.Geometry;
using UnitsNet;

// Circle
var circle = new Circle2(LengthVector2.FromMeters(0, 0), Radius.FromMeters(5));
bool hit = circle.Contains(LengthVector2.FromMeters(3, 4)); // true

// Directional — a unit-magnitude direction
var dir = Directional.FromDegrees(45); // North-East
var rotated = dir.Rotate(Angle.FromDegrees(90)); // North-West (135°)

// Arc
var arc = new Arc2(circle, Directional.East, Angle.FromDegrees(90));
Length arcLen = arc.ArcLength; // π/2 × 5 m ≈ 7.85 m

// Polygon
var hex = Polygon2.CreateRegular(LengthVector2.Zero, Length.FromMeters(1), 6);
Area hexArea = hex.Area;

Primitive types

Type Description
Directional Unit-magnitude direction with rotation and compass helpers
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.

Source repository

thunder-unitsnet-vectors

Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.2.0 23 4/14/2026