GraphHelpers 1.0.0

dotnet add package GraphHelpers --version 1.0.0
NuGet\Install-Package GraphHelpers -Version 1.0.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="GraphHelpers" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GraphHelpers --version 1.0.0
#r "nuget: GraphHelpers, 1.0.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.
// Install GraphHelpers as a Cake Addin
#addin nuget:?package=GraphHelpers&version=1.0.0

// Install GraphHelpers as a Cake Tool
#tool nuget:?package=GraphHelpers&version=1.0.0

Graph Helpers

This C# project contains helper classes for working with graphs and geometry.

Features

  • Angle - Represents an angle value with helper methods for converting between radians and degrees
  • AngleHelper - Contains methods for calculating angles between vectors
  • Lines - Calculates angles between successive points along a line
  • PointD - Represents a point in 2D space using double precision

Usage

Calculating angles along a route

// Create sample points
var points = new[] 
{
  new PointD(0, 0),
  new PointD(1, 0), 
  new PointD(2, 1)
};

// Calculate angles
var angles = Lines.GetAnglesForLine(points);

// Print results
foreach (var (point, angle) in angles)
{
  Console.WriteLine($"At point {point}, angle is {angle.DegreeValue} degrees");
}

Creating and manipulating angles

// Create 90 degree angle 
var ninetyDeg = Angle.FromDegrees(90);

// Convert to radians
var ninetyRad = ninetyDeg.RadianValue;

// Add two angles
var sum = thirtyDeg + sixtyDeg;

Classes

Angle

Represents an angle value in radians and degrees. Provides methods to:

  • Create angles from radians or degrees
  • Convert between units
  • Add angles together

AngleHelper

Contains the Cos3Pnt method to calculate the angle between 3 vectors using the cosine formula.

Lines

Provides the GetAnglesForLine method to calculate angles between successive points along a route.

PointD

Represents a 2D point using double precision. Overloads operators like +, -, * for manipulating points.

Installation

PM > Install-Package GraphHelpers

License

This project is licensed under the MIT license. See LICENSE for details.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 154 8/4/2023