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
- Host: GitHub
- URL: https://github.com/gamestdio/mathf
- Owner: gamestdio
- License: mit
- Created: 2017-08-06T15:14:27.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-09T13:18:13.000Z (almost 9 years ago)
- Last Synced: 2025-04-02T15:05:33.698Z (about 1 year ago)
- Language: TypeScript
- Homepage: http://gamestd.io/mathf/
- Size: 114 KB
- Stars: 23
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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