Dan's Geometry Library

A 15th century mathematician working at his desk.

An easy-to-implement function library providing numeric operations to handle solutions to typical problems encountered in the field of geometry, including Bezier Curves, Linear Interpolation (Lerp), and Trigonometry.

 

NEW! Simple 3D projection of lines and points! Create a Camera3D or CameraOrtho, set its Position and LookAt properties, then feed it points and lines from world space all day long.

 

Table of Contents

You can jump to any section of this page from the following list.

 

25 Years of .NET

Although .NET doesn't officially turn 25 until February 13, 2027, I'm starting the celebration a little early.

To commemorate 25 years since the public release of the .NET framework, I'm open sourcing this and several other of my long-lived libraries and applications. Most of these have only previously been used privately in our own internal company productivity during the early 21st century but I hope they might find a number of new uses to complete the next 25 years.

I have every intention of keeping these libraries and applications maintained, so if you happen to run into anything you would like to see added, changed, or repaired, just let me know in the Issues section and I'll get it done for you as time permits.

 

Sincerely,

Daniel Patterson, MCSD (danielanywhere)

 

Yet Another Geometry Library

Geometry is a surprisingly persistent companion in my work. Time and again, I find myself tackling scenarios where geometric functionality is not just helpful - it’s essential. Whether it’s displaying a line illustration projected in 3D, converting vectors to absolute coordinates, calculating the length of a guy wire with a Bézier-shaped sag, or determining the number of passes required for a mill bit to clear an area bounded by a polyline, geometry is always at the core of the solution. These repeated encounters inspired me to develop and maintain this geometric function library.

This library has a long history, originating in 1997 when I first created a version of it in the VBA scripting language to extend Microsoft Excel’s capabilities through their Office Automation extensions. It quickly became evident that its utility extended far beyond those early roots, prompting me to convert the library to C# in 2001. Since then, it has been an integral tool in my internal .NET projects, continuously evolving to meet new challenges.

 

Geometric Descriptors

In the current version, you will find these primitive geometric descriptor classes that can be used generically anywhere:

Our geometric descriptors differ from others on two main features. First, all of our geometric descriptors are first-class objects, which allows you to pass everything by reference, maintain multiple references to the same coordinate, whose member values can be changed singularly from everywhere, and other benefits one gets from single instance storage. Secondly, many of our geometric descriptors provide event-based support for changing values and other notable circumstances.

 

Utility Classes

The Geometry library also contains the following utility classes for reaching answers in different categories.

Through these features, this library aims to simplify and streamline geometric operations, empowering you to tackle projects with confidence and ease.

Other related classes from around our software environment will be added soon to this library, so stay tuned...

 

Installation

You can include this library in any .NET project using any supported programming language or target system. This library compiles as .NET Standard 2.0 and is available in NuGet as

Dan's Geometry Library

 

Instructions For Installation

In Visual Studio Community or Visual Studio Professional editions:

 

In Visual Studio Code:

 

Usage Notes

This library is intended to be used on any target system, avoiding any kind of Windows dependencies whatsoever. As a result, replacements for GDI+ dimensional objects, like Point, Rectangle, and others normally found in .NET system libraries like System.Drawing have been defined for generic public use with or without a statically typed graphics system.

To see working examples of various uses of this library, see the Source/GeometryExample folder, where I add various tests and use-cases to a stand-alone application before publishing each version.

If you would like to see a bigger-picture view of the library in daily use, review some of the source of my other GitHub project danielanywhere/ShopTools. That project uses Dan's Geometry Library to draw graphics, calculate distances, and perform a lot of the heavy lifting.

For the full documentation of this library, you can access the API in HTML format at the associated GitHub user page library https://danielanywhere.github.io/Geometry.