Code Monkey home page Code Monkey logo

tmath's Introduction

Math

GitHub Actions CI

A collection of mathematical function and data structures written in C#.

(c) 2016-2024 Thierry Matthey - MIT license

Base

  • Floating point comparison and epsilon
  • Conversion radian-degree, 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 sin-cos 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)
  • k-d 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 Partition-and-Group 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
  • Line draw - Bresenham and anti-aliasing (Xiaolin Wu's line algorithm)
  • Point plot (anti-aliasing)
  • Heatmap for arbitrary set of GPS tracks with color schemes

Applications / examples

  • GPS cluster
  • GPS heatmap
  • GPS activity
  • HR index

heatmap.png

tmath's People

Contributors

tmatthey avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.