Git Product home page Git Product logo

mth's Introduction

mth - A Maths library

mth is a maths library built around template classes to work with objects such as vectors, matrices and quaternions, with helper classes to deal with solving equations. No guarantees of stability or quality atm so be warned.

Building:

To build from source, you will need cmake and a c++ compiler supporting c++17.

First, clone the repo and run cmake:

$ git clone https://github.com/Luminiscental/mth
$ cd mth && mkdir build && cd build
$ cmake .. # Optionally pass -DTESTS=ON to run tests when building

Then run the generated build files, on mac/linux there should be a Makefile in the build directory that you can run with make. On windows there should be a Visual Studio solution file mth.sln, open this and build the solution.

After building there should be a libmth.a or mth.lib file for linking into programs that use mth.

Features:

  • Relevant constants defined: e.g. pi and tau, coordinate bases.
  • N-dimensional vector of any given scalar type (that has most arithmetic operators / functions defined on it) for N at least 1.
  • N,M-dimensional matrix of any given scalar type (same as above) for N and M at least 2.
  • Augmentations of square matrices with any type that supports addition and scalar multiplication (e.g. float, mth::comp, mth::tvec), with row operations and functions to convert to echelon / reduced echelon form.
  • Quaternions of any given scalar type (you get the idea) with arithmetic operators and functions for representing rotations in 3-space (and converting to the equivalent matrices).
  • Complex number representations with arithmetic and overloads for std::exp, std::cos, std::sin and std::abs.
  • Polynomials with arithmetic, a solve() method for finding roots and a value() method for evaluating.
  • Numerical calculation of the limits of sequences or of complex functions at a point.
  • Power series with complex coefficients allowing evaluation at points and differentiation/integration.
  • Differentiation and integration of polynomials.
  • Somewhat pretty printing.

Planned features:

  • Numeric methods for finding roots of arbitrary functions
  • Numerical series expansions

mth's People

Contributors

luminiscental avatar

Stargazers

 avatar

Watchers

 avatar  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.