Gapotchenko.FX.Math.Geometry
2022.2.7
Prefix Reserved
dotnet add package Gapotchenko.FX.Math.Geometry version 2022.2.7
NuGet\InstallPackage Gapotchenko.FX.Math.Geometry Version 2022.2.7
<PackageReference Include="Gapotchenko.FX.Math.Geometry" Version="2022.2.7" />
paket add Gapotchenko.FX.Math.Geometry version 2022.2.7
#r "nuget: Gapotchenko.FX.Math.Geometry, 2022.2.7"
// Install Gapotchenko.FX.Math.Geometry as a Cake Addin #addin nuget:?package=Gapotchenko.FX.Math.Geometry&version=2022.2.7 // Install Gapotchenko.FX.Math.Geometry as a Cake Tool #tool nuget:?package=Gapotchenko.FX.Math.Geometry&version=2022.2.7
Overview
The module provides primitives and operations for geometry math.
StringMetrics
StringMetrics
static class provides a variety of metric functions for measuring the distance between two strings of symbols.
The notion of a string is purely abstract.
So it is not limited to just characters like System.String
; it can be a string of anything in form of IEnumerable<T>
.
In this way, Gapotchenko.FX.Math.Geometry
module achieves the right degree of abstraction desirable for a versatile math toolkit.
Edit Distance
Edit distance is a string metric reflecting the minimum number of operations required to transform one string into the other. There are several ways to measure the edit distance.
The table below compares edit distance measurement functions provided by StringMetrics
class:
Metric Function  Insertion  Deletion  Substitution  Transposition 

Levenshtein distance  ✓  ✓  ✓  
Longest common subsequence (LCS) distance  ✓  ✓  
Hamming distance  ✓  
Damerau–Levenshtein distance  ✓  ✓  ✓  ✓ 
Optimal string alignment (OSA) distance  ✓  ✓  ✓  ✓ 
Jaro distance  ✓ 
Levenshtein Distance
StringMetrics.LevenshteinDistance
method allows to calculate the Levenshtein distance between two strings of symbols.
Consider the example:
using Gapotchenko.FX.Math.Geometry;
int distance = StringMetrics.LevenshteinDistance("ABC", "BAC");
Console.WriteLine("Distance is {0}.", distance); // distance = 2
Longest Common Subsequence (LCS) Distance
StringMetrics.LcsDistance
method allows to calculate the longest common subsequence (LCS) distance between two strings of symbols.
Consider the example:
using Gapotchenko.FX.Math.Geometry;
int distance = StringMetrics.LcsDistance("ABC", "BAC");
Console.WriteLine("Distance is {0}.", distance); // distance = 2
Hamming Distance
StringMetrics.HammingDistance
method allows to calculate the Hamming distance between two strings of symbols.
Consider the example:
using Gapotchenko.FX.Math.Geometry;
int distance = StringMetrics.HammingDistance("ABC", "BAC");
Console.WriteLine("Distance is {0}.", distance); // distance = 2
DamerauLevenshtein Distance
StringMetrics.DamerauLevenshteinDistance
method allows to calculate the Damerau–Levenshtein distance between two strings of symbols.
Consider the example:
using Gapotchenko.FX.Math.Geometry;
int distance = StringMetrics.DamerauLevenshteinDistance("ABC", "BAC");
Console.WriteLine("Distance is {0}.", distance); // distance = 1
Optimal String Alignment (OSA) Distance
StringMetrics.OsaDistance
method allows to calculate the optimal string alignment (OSA) distance between two strings of symbols.
Consider the example:
using Gapotchenko.FX.Math.Geometry;
int distance = StringMetrics.OsaDistance("ABC", "BAC");
Console.WriteLine("Distance is {0}.", distance); // distance = 1
Jaro Distance
StringMetrics.JaroDistance
method allows to calculate the Jaro distance between two strings of symbols.
Although the Jaro distance is often referred to as an edit distance metric, its value does not represent a number of edit operations and varies between 0 and 1 such that 0 is an exact match and 1 equates to no similarities.
Consider the example:
using Gapotchenko.FX.Math.Geometry;
double distance = StringMetrics.JaroDistance("ABC", "BAC");
Console.WriteLine("Distance is {0.00}.", distance); // distance = 0.44
Commonly Used Types
 Gapotchenko.FX.Math.Geometry.StringMetrics
Other Modules
Let's continue with a look at some other modules provided by Gapotchenko.FX:
 Gapotchenko.FX
 Gapotchenko.FX.AppModel.Information
 Gapotchenko.FX.Collections
 Gapotchenko.FX.Console
 Gapotchenko.FX.Data
 Gapotchenko.FX.Diagnostics
 Gapotchenko.FX.IO
 Gapotchenko.FX.Linq
 Gapotchenko.FX.Math
 Gapotchenko.FX.Memory
 Gapotchenko.FX.Security.Cryptography
 Gapotchenko.FX.Text
 Gapotchenko.FX.Threading
Or look at the full list of modules.
Product  Versions Compatible and additional computed target framework versions. 

.NET  net5.0 is compatible. net5.0windows was computed. net6.0 is compatible. net6.0android was computed. net6.0ios was computed. net6.0maccatalyst was computed. net6.0macos was computed. net6.0tvos was computed. net6.0windows was computed. net7.0 is compatible. net7.0android was computed. net7.0ios was computed. net7.0maccatalyst was computed. net7.0macos was computed. net7.0tvos was computed. net7.0windows was computed. net8.0 was computed. net8.0android was computed. net8.0browser was computed. net8.0ios was computed. net8.0maccatalyst was computed. net8.0macos was computed. net8.0tvos was computed. net8.0windows was computed. 
.NET Core  netcoreapp2.0 is compatible. netcoreapp2.1 is compatible. netcoreapp2.2 was computed. netcoreapp3.0 is compatible. netcoreapp3.1 was computed. 
.NET Standard  netstandard2.0 is compatible. netstandard2.1 is compatible. 
.NET Framework  net46 is compatible. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 is compatible. net472 is compatible. net48 was computed. net481 was computed. 
MonoAndroid  monoandroid was computed. 
MonoMac  monomac was computed. 
MonoTouch  monotouch was computed. 
Tizen  tizen40 was computed. tizen60 was computed. 
Xamarin.iOS  xamarinios was computed. 
Xamarin.Mac  xamarinmac was computed. 
Xamarin.TVOS  xamarintvos was computed. 
Xamarin.WatchOS  xamarinwatchos was computed. 

.NETCoreApp 2.0
 Gapotchenko.FX.Collections (>= 2022.2.7)
 Gapotchenko.FX.Linq (>= 2022.2.7)
 Gapotchenko.FX.Math (>= 2022.2.7)

.NETCoreApp 2.1
 Gapotchenko.FX.Collections (>= 2022.2.7)
 Gapotchenko.FX.Linq (>= 2022.2.7)
 Gapotchenko.FX.Math (>= 2022.2.7)

.NETCoreApp 3.0
 Gapotchenko.FX.Collections (>= 2022.2.7)
 Gapotchenko.FX.Linq (>= 2022.2.7)
 Gapotchenko.FX.Math (>= 2022.2.7)

.NETFramework 4.6
 Gapotchenko.FX.Collections (>= 2022.2.7)
 Gapotchenko.FX.Linq (>= 2022.2.7)
 Gapotchenko.FX.Math (>= 2022.2.7)

.NETFramework 4.7.1
 Gapotchenko.FX.Collections (>= 2022.2.7)
 Gapotchenko.FX.Linq (>= 2022.2.7)
 Gapotchenko.FX.Math (>= 2022.2.7)

.NETFramework 4.7.2
 Gapotchenko.FX.Collections (>= 2022.2.7)
 Gapotchenko.FX.Linq (>= 2022.2.7)
 Gapotchenko.FX.Math (>= 2022.2.7)

.NETStandard 2.0
 Gapotchenko.FX.Collections (>= 2022.2.7)
 Gapotchenko.FX.Linq (>= 2022.2.7)
 Gapotchenko.FX.Math (>= 2022.2.7)

.NETStandard 2.1
 Gapotchenko.FX.Collections (>= 2022.2.7)
 Gapotchenko.FX.Linq (>= 2022.2.7)
 Gapotchenko.FX.Math (>= 2022.2.7)

net5.0
 Gapotchenko.FX.Collections (>= 2022.2.7)
 Gapotchenko.FX.Linq (>= 2022.2.7)
 Gapotchenko.FX.Math (>= 2022.2.7)

net6.0
 Gapotchenko.FX.Collections (>= 2022.2.7)
 Gapotchenko.FX.Linq (>= 2022.2.7)
 Gapotchenko.FX.Math (>= 2022.2.7)

net7.0
 Gapotchenko.FX.Collections (>= 2022.2.7)
 Gapotchenko.FX.Linq (>= 2022.2.7)
 Gapotchenko.FX.Math (>= 2022.2.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.