<div align="center">
  <img src="https://user-images.githubusercontent.com/99760654/181651187-460b7786-d8c1-4a2a-97f8-f95fed8542d2.png" width="200" />
  
  <h1>Mirage Math</h1>
  <p>A library brought to you by Mirage to make complex calculations.</p>
</div>

## ⚙️ Technologies

- 🟦 TypeScript
- 🟪 ESLint

This is a library which doesn't require any major dependencies.

## 📝 Documentation

Our API documentation is currently in development, it will be released on the next update.

> **Note**: We have an update, the documentation is almost complete. It just needs to be deployed to GitHub Pages.

## 🖼️ Basic Usage

```js
import { MirateMath } from "@enginemirage/math";
const math = new MirageMath();

// The following is a list of a couple
// constants automatically provided
// by Mirage

math.PI; // Returns the value of PI
math.E; // Returns Euler's Constant
math.SQRT2; // Returns the square root of 2 (sqrt(2))
math.LN2; // Returns the constant value as base 2
math.LN10; // Returns the constant value as base 10

// A couple functions provided by MirageMath

math.clamp(-50, 0, 100); // Clamps a number between two values --> 0
math.sqrt(4489); // Returns the square root of 4449 --> 67
math.cbrt(729000); // Returns the cube root of 729000 --> 90
math.log2(4); // Returns the base-2 logarithm of 4 --> 2
math.log10(4); // Returns the base-10 logarithm of 4 --> 0.60205999132
math.log1p(4); // Returns the logarithm of 4, plus 1 --> 3

// How to implement standard logarithms:
math.log1p(4) - 1;
```

> **Note**: This library is under heavy development, so currently the constants and functions listed above are the only available ones. This package is being updated **extremely** often, so you can expect to see many more features. Such as: vectors, logarithms, etc.

## 📦 Installation

You can install MirageMath using the following package managers (all of which fetch the npm registry):

`npm`:

```bash
npm install @enginemirage/math
```

`yarn`:

```bash
yarn add @enginemirage/math
```

`pnpm`:

```bash
pnpm add @enginemirage/math
```

## 🧑🏼‍🤝‍🧑🏻 Contributing

You can contribute by forking the repository and submitting a pull request. Your pull request will be reviewed and it will be accepted respectively.

### Roadmap

- Vectors
- Logarithms
- Absolute value
- Sine
- Cosine
- Tangent
  - Arcsine
  - Arccosine
  - Arctangent
  - Atan2 (Arctangent of the quotient of its arguments)
- Hypotenuse
- Hyperbolic Cosine
- Floor (largest integer <= `x`)

- Value conversions
- Triangle measurements

There are many, many more features planned for this library. Most of which will be covered in the first week or two of release.

## ⛔ Issues

If you find any bugs or have problems with this library. You may submit them in the [issues tab](https://github.com/enginemirage/bettermath/issues) of this GitHub repository.
