Gon 0.0.1

dotnet add package Gon --version 0.0.1
                    
NuGet\Install-Package Gon -Version 0.0.1
                    
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="Gon" Version="0.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Gon" Version="0.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Gon" />
                    
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 Gon --version 0.0.1
                    
#r "nuget: Gon, 0.0.1"
                    
#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 Gon@0.0.1
                    
#: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=Gon&version=0.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Gon&version=0.0.1
                    
Install as a Cake Tool

Gon.cs

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Installation

Install the latest .NET SDK.

User

Download and install the latest stable version from NuGet repository

dotnet add package Gon

Developer

Download the latest version from GitHub repository

git clone https://github.com/lycantropos/Gon.cs

Install

dotnet add reference Gon.cs/src/Gon/Gon.csproj

Usage

using System.Diagnostics;

using Point = Gon.Point<double>;
using Contour = Gon.Contour<double>;
using Polygon = Gon.Polygon<double>;
using Location = Gon.Location;

namespace GonExamples
{
    public static class Basic
    {
        public static void RunExamples()
        {
            // construction
            var squareBorder = new Contour(
                new[] { new Point(0, 0), new Point(4, 0), new Point(4, 4), new Point(0, 4) }
            );
            var square = new Polygon(squareBorder);

            // accessing various properties
            Debug.Assert(square.Border == squareBorder);
            Debug.Assert(square.Border.Vertices.Length == 4);
            Debug.Assert(square.Holes.Length == 0);

            // equality checks
            Debug.Assert(square == new Polygon(squareBorder));

            // point-in-polygon checks
            Debug.Assert(square.Contains(new Point(2, 2)));
            Debug.Assert(square.Contains(new Point(4, 4)));
            Debug.Assert(!square.Contains(new Point(6, 6)));

            // point location queries
            Debug.Assert(square.Locate(new Point(2, 2)) == Location.Interior);
            Debug.Assert(square.Locate(new Point(4, 4)) == Location.Boundary);
            Debug.Assert(square.Locate(new Point(6, 6)) == Location.Exterior);

            // set intersection
            Polygon[] intersection = square & square;
            Debug.Assert(intersection.Length == 1);
            Debug.Assert(intersection[0] == square);

            // set union
            Polygon[] union = square | square;
            Debug.Assert(union.Length == 1);
            Debug.Assert(union[0] == square);

            // set difference
            Polygon[] difference = square - square;
            Debug.Assert(difference.Length == 0);

            // set symmetric difference
            Polygon[] symmetricDifference = square ^ square;
            Debug.Assert(symmetricDifference.Length == 0);
        }
    }
}

More examples can be found at src/GonExamples directory.

Development

Bumping version

Preparation

Install bump2version.

Pre-release

Choose which version number category to bump following semver specification.

Test bumping version

bump2version --dry-run --verbose $CATEGORY

where $CATEGORY is the target version number category name, possible values are patch/minor/major.

Bump version

bump2version --verbose $CATEGORY

This will set version to major.minor.patch-alpha.

Release

Test bumping version

bump2version --dry-run --verbose release

Bump version

bump2version --verbose release

This will set version to major.minor.patch.

Running tests

In what follows python is an alias for python3.8 or any later version (python3.9 and so on).

Install dependencies

python -m pip install -r requirements-tests.txt

Run tests

pytest
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  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.  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 was computed.  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. 
.NET Core netcoreapp1.0 was computed.  netcoreapp1.1 was computed.  netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard1.3 is compatible.  netstandard1.4 is compatible.  netstandard1.5 is compatible.  netstandard1.6 is compatible.  netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 is compatible.  net461 was computed.  net462 was computed.  net463 was computed.  net47 is compatible.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen30 was computed.  tizen40 was computed.  tizen60 was computed. 
Universal Windows Platform uap was computed.  uap10.0 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
0.0.1 306 7/19/2023
0.0.0 272 7/12/2023