Skip to content
/ math Public

Yet another c++ library with various mathematical structures and function.

License

Notifications You must be signed in to change notification settings

dmilos/math

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Miscellaneous mathematical structures and function

Status:

  • Some kind of Beta.

Description

  • Yet another c++ library with various mathematical structures and function.

Key features:

  • Headers only
  • One file to include to start the fun
  • Primitives: circle, direction, ellipse, interval, plane, quadric, tetrahedron, triangle
  • Function:
    • vector, matrix, affine operation
    • distances, intersections between primitives
  • etc.

Code sample

#include <iostream>
#include <iomanip>
#include <string>

#include "math/math.hpp"

using namespace std;

int main( int argc, char *argv[] )
 {
  ::math::linear::vector::point<double,2>   point{100,100};
  ::math::geometry::direction::parametric<double,2>   direction({ 5,5}, { 1,2});

  ::math::geometry::ellipse::base2D<double>     b{ 20, 30 };
  ::math::geometry::ellipse::simple2D<double>   s{ {10, 15}, 20, 30   };
  ::math::geometry::ellipse::general2D<double>  g{ {10, 15}, 20, 30, ::math::geometry::deg2rad( 60 ) };

  // Convert from one representation to another
   g = g;  g= s;   g = b;
           s = s;  s = b;

  ::math::geometry::ellipse::distance( b, point );
  ::math::geometry::ellipse::distance( s, point );
  ::math::geometry::ellipse::distance( g, point );

  double l0, l1;

  ::math::geometry::ellipse::intersect( l0, l1, b, direction );
  ::math::geometry::ellipse::intersect( l0, l1, s, direction );
  ::math::geometry::ellipse::intersect( l0, l1, g, direction );

  cin.get();
  return EXIT_SUCCESS;
 }

Install:

  1. Clone this Repository:
    Examples:
  2. Inform compiler where to find headers:
    Examples:
    • MSVC : /Ic:\my-work-folder\my-git-folder\math\src
    • gcc : -I/home/my-user-name/my-work-folder/my-git-folder/math/src

Content in details:

  • complex
    • quaternion
      • quaternion arithmetic
  • function
    • N dimensional Lebesgue/Z functions
  • geometry
    • circle
      • Different circle structures, intersections with direction
    • direction
      • Direction structures and manipulation
    • ellipse
      • Ellipse structures and manipulation
    • interval
      • Interval structures and manipulation
    • plane
      • Plane structures and manipulation
    • projective
      • Epipolar functions.
    • quadric
      • create quadric from circle and ellipse
    • tetrahedron
      • Calculate volume
    • triangle
      • Calculate area
  • grammar
  • linear
  • affine
    • Affine structure and manipulation ( addition, subtraction, compose, etc. )
  • homography
    • Make and transform functions
  • matrix
    • Matrix structure and manipulation ( addition, subtraction, compose, etc. )
  • vector
    • Vector manipulation
  • logic
    • Empty so far
  • polynomial
    • Polynomial manipulation
  • random
    • Sobol and vdc functions
  • statistic
    • Gaussian, average, count.

Tested against:

  • GCC 7.3.0
  • GCC 7.4.0
  • GCC 9.3.0
  • MSVC 2015 Update 3
  • MSVC 2017 (15.9.14)
  • MSVC 2019 (16.2.3)

About

Yet another c++ library with various mathematical structures and function.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages