Math.Matthey
2.3.1
A collection of mathematical function and data structures written in C#.
Numerical comparison, vector geometry, polynomial, root solver, statistics, GPS and clustering, and abstract bitmap and draw functions.
InstallPackage Math.Matthey Version 2.3.1
dotnet add package Math.Matthey version 2.3.1
<PackageReference Include="Math.Matthey" Version="2.3.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Math.Matthey version 2.3.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Math
A collection of mathematical function and data structures written in C#.
(c) 20162019 T. Matthey  MIT license
Base
 Floating point comparison and epsilon
 Conversion radiandegree, date time to seconds
Solver
 Analytical solution of linear, quadratic, cubic and quartic polynomial equations
 Numerical general polynomial equation root solver
 General root solver with either bisection or secant method
 First and second order regression with optional weight
Functions
 Qudratic root
 Cubic root
 Quartic root
 Fast sin evaluation [PI/2, PI/2]
 Normalize angle
 Nomerical stable sincos evaluation
 Factorial; ulong (n <= 20) and double
 Fibonacci; ulong (n <= 93), double and Binet
 Greatest common divisor (GDC)
 IsPrime; no cache; ~3s for max long / 10
Statistics
 Arithmetic mean and variance, optional weighted
 Averageing / mean of angles
 Centered moving averageing, optional weighted
Geometry
 Convex hull 2D (Jarvis march & Andrew's monotone chain; point reduction algorithm)
 Minimal bounding circle 2D
 Minimal bounding circle on sphere 3D
 Perpendicular (segment / line ) distance (2D & 3D)
 Trajectory Hausdorff Distance (2D & 3D)
 Filter of significant points based on Minimum Description Length Principle (2D & 3D)
 kd tree search for vector & segment (2D & 3D)
Data structures
 BoundingBox
 BoundingRect
 Circle2D
 Circle3D
 CubicBezier2D
 CubicBezier3D
 Color
 Polar3D
 Polynomial

 Division by real roots (linear root), and imaginary and conjugated (quadratic root)

 Evaluation of polynomial and its derivative and integral
 Segment2D
 Segment3D
 Sparse array
 Vector2D
 Vector3D
GPS
 GpsPoint
 GpsTrack
 Flatten to local 2D; single object and collection
 Smoothing of holes (missing GPS signal, same position) by reducing variance
 Geodesy

 Haversine distance
 GridLookup / NeighbourDistanceCalculator : Finding neighbors of two GPS tracks in O(N)
 Intersection / overlapping (overestimating) of two GPS tracks

 grid / lookup table based  fastest and pretty precise depending on given resolution

 minimal rectangular bounding box

 minimal circle on sphere  slow on 1st call to calculate min circle
Clustering
 DBScan vector / segment for 2D / 3D
 TraClus (Trajectory Clustering: A PartitionandGroup Framework) for 2D and 3D
 Finding trajectory neighborhoods for 2D and 3D
 GPS segment clustering; finding common segments for locally collocated GPS tracks or globally
Gfx
 PNG, PPM and PGM bitmap writer
 Simple bitmap
 RGB color bitmap
 Line draw  Bresenham and antialiasing (Xiaolin Wu's line algorithm)
 Point plot (antialiasing)
 Heatmap for arbitrary set of GPS tracks with color schemes
Math
A collection of mathematical function and data structures written in C#.
(c) 20162019 T. Matthey  MIT license
Base
 Floating point comparison and epsilon
 Conversion radiandegree, date time to seconds
Solver
 Analytical solution of linear, quadratic, cubic and quartic polynomial equations
 Numerical general polynomial equation root solver
 General root solver with either bisection or secant method
 First and second order regression with optional weight
Functions
 Qudratic root
 Cubic root
 Quartic root
 Fast sin evaluation [PI/2, PI/2]
 Normalize angle
 Nomerical stable sincos evaluation
 Factorial; ulong (n <= 20) and double
 Fibonacci; ulong (n <= 93), double and Binet
 Greatest common divisor (GDC)
 IsPrime; no cache; ~3s for max long / 10
Statistics
 Arithmetic mean and variance, optional weighted
 Averageing / mean of angles
 Centered moving averageing, optional weighted
Geometry
 Convex hull 2D (Jarvis march & Andrew's monotone chain; point reduction algorithm)
 Minimal bounding circle 2D
 Minimal bounding circle on sphere 3D
 Perpendicular (segment / line ) distance (2D & 3D)
 Trajectory Hausdorff Distance (2D & 3D)
 Filter of significant points based on Minimum Description Length Principle (2D & 3D)
 kd tree search for vector & segment (2D & 3D)
Data structures
 BoundingBox
 BoundingRect
 Circle2D
 Circle3D
 CubicBezier2D
 CubicBezier3D
 Color
 Polar3D
 Polynomial

 Division by real roots (linear root), and imaginary and conjugated (quadratic root)

 Evaluation of polynomial and its derivative and integral
 Segment2D
 Segment3D
 Sparse array
 Vector2D
 Vector3D
GPS
 GpsPoint
 GpsTrack
 Flatten to local 2D; single object and collection
 Smoothing of holes (missing GPS signal, same position) by reducing variance
 Geodesy

 Haversine distance
 GridLookup / NeighbourDistanceCalculator : Finding neighbors of two GPS tracks in O(N)
 Intersection / overlapping (overestimating) of two GPS tracks

 grid / lookup table based  fastest and pretty precise depending on given resolution

 minimal rectangular bounding box

 minimal circle on sphere  slow on 1st call to calculate min circle
Clustering
 DBScan vector / segment for 2D / 3D
 TraClus (Trajectory Clustering: A PartitionandGroup Framework) for 2D and 3D
 Finding trajectory neighborhoods for 2D and 3D
 GPS segment clustering; finding common segments for locally collocated GPS tracks or globally
Gfx
 PNG, PPM and PGM bitmap writer
 Simple bitmap
 RGB color bitmap
 Line draw  Bresenham and antialiasing (Xiaolin Wu's line algorithm)
 Point plot (antialiasing)
 Heatmap for arbitrary set of GPS tracks with color schemes
Release Notes
Fixed Bezier Curve length
Dependencies

.NETCoreApp 1.1
 Microsoft.NETCore.App (>= 1.1.2)
 System.ValueTuple (>= 4.3.0)
 ZKWeb.System.Drawing (>= 3.0.0)

.NETFramework 4.0
 System.ValueTuple (>= 4.3.0)

.NETStandard 1.5
 NETStandard.Library (>= 1.6.1)
 System.ValueTuple (>= 4.3.0)
 ZKWeb.System.Drawing (>= 3.0.0)