An open API service indexing awesome lists of open source software.

https://github.com/gamestdio/mathf

A collection of common math functions for JavaScript / TypeScript
https://github.com/gamestdio/mathf

Last synced: about 1 year ago
JSON representation

A collection of common math functions for JavaScript / TypeScript

Awesome Lists containing this project

README

          

# @gamestdio/mathf

A collection of common math functions for JavaScript/TypeScript.

## Installation

```
npm install @gamestdio/mathf
```

## Usage

```typescript
import { lerpAngle, rad2Deg, deg2Rad } from "@gamestdio/mathf";

let targetAngle = Math.PI * rad2Deg;
sprite.rotation = lerpAngle(sprite.rotation * rad2Deg, targetAngle, 0.1) * deg2Rad;
```

## References
- https://github.com/likerRr/mathf-js
- https://docs.unity3d.com/ScriptReference/Mathf.html

## License

MIT