{"id":18075017,"url":"https://github.com/lnsp/tmath","last_synced_at":"2026-01-14T18:28:52.540Z","repository":{"id":26339052,"uuid":"29787814","full_name":"lnsp/tmath","owner":"lnsp","description":"Math library based on taylor series including vectors and utility functions","archived":true,"fork":false,"pushed_at":"2018-07-11T12:05:57.000Z","size":190,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-27T17:04:57.212Z","etag":null,"topics":["c-plus-plus","cosine","logarithm","math","matrix","scientific-computing","secant","sine","taylor-series","vector"],"latest_commit_sha":null,"homepage":"https://lnsp.github.io/tmath","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lnsp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-24T19:00:10.000Z","updated_at":"2024-09-27T22:56:56.000Z","dependencies_parsed_at":"2022-07-12T13:00:29.290Z","dependency_job_id":null,"html_url":"https://github.com/lnsp/tmath","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/lnsp/tmath","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lnsp%2Ftmath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lnsp%2Ftmath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lnsp%2Ftmath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lnsp%2Ftmath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lnsp","download_url":"https://codeload.github.com/lnsp/tmath/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lnsp%2Ftmath/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28430820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-plus-plus","cosine","logarithm","math","matrix","scientific-computing","secant","sine","taylor-series","vector"],"created_at":"2024-10-31T10:44:12.052Z","updated_at":"2026-01-14T18:28:52.521Z","avatar_url":"https://github.com/lnsp.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TMath [![Build status](https://travis-ci.org/lnsp/tmath.svg?branch=stable)](https://travis-ci.org/lnsp/tmath)\nA small math function collection based on the Taylor expansion series.\n\n## Building the project\n- Download the source files from the `master`-tree\n- To build the project, you need to have `g++` and `make` installed\n- And you need to run `export CC=g++`\n- If everything is ready, run `make` and ...\n- ... your `libtmath.a` library file is ready in the `lib` folder\n\n## How to use\nJust build it as described above, include the header files and link the library. The library uses the types `TMath::DOUBLE`(`long double`) and `TMath::LONG`(`long long`) for parameters and return values.\n\n## What is included?\n### Mathematical functions\n\nFunction                                | Description\n:-------------------------------------: | ---------------------------------------------------------\n`sin(DOUBLE x)`                         | sine of x\n`asin(DOUBLE x)`                        | arcsine of x\n`sinh(DOUBLE x)`                        | hyperbolic sine of x\n`cos(DOUBLE x)`                         | cosine of x\n`acos(DOUBLE x)`                        | arccosine of x\n`cosh(DOUBLE x)`                        | hyperbolic cosine of x\n`tan(DOUBLE x)`                         | tangent of x\n`atan(DOUBLE x)`                        | arctangent of x\n`cot(DOUBLE x)`                         | cotangent of x\n`acot(DOUBLE x)`                        | arccotangent of x\n`coth(DOUBLE x)`                        | hyperbolic cotangent of x\n`sec(DOUBLE x)`                         | secant of x\n`asec(DOUBLE x)`                        | arcsecant of x\n`sech(DOUBLE x)`                        | hyperbolic secant of x\n`cosec(DOUBLE x)`                       | cosecant of x\n`acsc(DOUBLE x)`                        | arccosecant of x\n`csch(DOUBLE x)`                        | hyperbolic cosecant of x\n`floor(DOUBLE x)`                       | next lower integer of x\n`ceil(DOUBLE x)`                        | next higher integer of x\n`mod(LONG x, LONG y)`                   | the remainder of the division x / y\n`exp(DOUBLE x)`                         | natural exponential function\n`sqrt(DOUBLE x)`                        | squareroot of x\n`root(DOUBLE x, DOUBLE n)`              | n-th root of x\n`ln(DOUBLE x)`                          | natural logarithm of x\n`lg(DOUBLE x)`                          | common logarithm of x\n`lb(DOUBLE x)`                          | binary logarithm of x\n`log(DOUBLE x, DOUBLE n)`               | logarithm with base n of x\n`pow(DOUBLE x, DOUBLE n)`               | x to the power of n\n`pow(LONG x, LONG n)`                   | x to the power of n\n`pow(DOUBLE x, LONG n)`                 | x to the power of n\n`fac(LONG n)`                           | factorial of n\n`facd(LONG n)`                          | factorial of n using floating point\n`oddfac(LONG n)`                        | odd-factorial of n\n`oddfacd(LONG n)`                       | odd-factorial of n using floating point\n`rad(DOUBLE x)`                         | degrees to radiant\n`deg(DOUBLE x)`                         | radiant to degrees\n`abs(DOUBLE x)`                         | absolute value of x\n`equal(DOUBLE x, DOUBLE y)`             | floating-point number equality\n`equal(DOUBLE x, DOUBLE y, DOUBLE eps)` | floating-point number equality with a variance of epsilon\n\n### Vector class\nTo initialize a new vector just use initializer lists (like `Vector {1, 2, 3}`) or create a null-vector using `Vector(n)` (where n is the number of dimensions).\n\nOperation       | Description\n--------------- | -------------------------------------------------------------\n`a[n]`          | Access the n-th element of the vector `a`\n`a.at(n)`       | Access the n-th element of the vector `a` as a constant\n`a + b`         | Adds vector `a` and `b`\n`a - b`         | Subtracts vector `a` from `b`\n`a * s`         | Scales the vector by the factor `s`\n`a / s`         | Scales the vector by the factor `1 / s`\n`a == b`        | Tests if vector `a` is equal to `b`\n`a != b`        | Tests if vector `a` is not equal to `b`\n`a.equal(b, e)` | Tests if the vector `a` is equal to `b` with the accuracy `e`\n`a.dot(b)`      | Dot product of `a` and `b`.\n`a.cross(b)`    | Cross product of `a` and `b`\n`a.norm()`      | Normalized copy of the vector `a`\n`a.length()`    | Length of vector `a`\n`a.dim()`       | Dimensions of vector `a`\n`a.to_string()` | Generates a string representation of the vector `a`\n\n### Matrix class\nTo initialize a new matrix you can use initializer lists (like `Matrix{{1, 0}, {0, 1}}`) or create a null-matrix using `Matrix(x, y)` (where x is the number of cols and y the number of rows).\n\nOperation       | Description\n--------------- | -------------------------------------------------------------\n`m[n]`          | Access the n-th row of the matrix\n`m[n][x]`       | Access the element at row n and col x\n`m.at(n)`       | Access the n-th row of the matrix as a constant\n`m.at(n, x)`    | Access the element at row n and col x as a constant\n`m * v`         | Multiply matrix `m` with vector `v`\n`m * a`         | Multiply matrix `m` with matrix `a`\n`m * s`         | Multiply matrix `m` with scalar `s`\n`-m`            | Negate matrix `m`\n`a + b`         | Add the matrices\n`a - b`         | Subtract the matrices\n`a.equal(b, e)` | Tests if the matrix `a` is equal to `b` with the accuary `e`\n`a == b`        | Tests if the matrix `a` is equal to `b`\n`a != b`        | Tests if the matrix `a` is not equal to `b`\n`a.colCount()`     | Get the number of matrix cols\n`a.rowCount()`    | Get the number of matrix rows\n`a.to_string()` | Generate a string representation of the matrix\n`identity(n)` | Generates an identity matrix of dimension `n`\n\n## What is planned?\n- Statistics\n- Numerics (e.g. solvers for ODE/PDE/LS)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flnsp%2Ftmath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flnsp%2Ftmath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flnsp%2Ftmath/lists"}