https://github.com/jgtools/jgmath
Math utils
https://github.com/jgtools/jgmath
2d-math game-math game-math-library javascript jgtools math typescript
Last synced: 26 days ago
JSON representation
Math utils
- Host: GitHub
- URL: https://github.com/jgtools/jgmath
- Owner: JGTools
- License: mit
- Created: 2022-12-08T20:20:42.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-25T02:34:58.000Z (over 1 year ago)
- Last Synced: 2025-07-16T05:09:43.833Z (11 months ago)
- Topics: 2d-math, game-math, game-math-library, javascript, jgtools, math, typescript
- Language: TypeScript
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JGMath
[](https://www.npmjs.com/package/@jgtools/jgmath)
[](https://www.npmjs.com/package/@jgtools/jgmath)
[](https://github.com/git/git-scm.com/blob/main/MIT-LICENSE.txt)
Math utils
## Installation
### Using npm
```bash
npm i @jgtools/jgmath
```
```javascript
// import all functions using a namespace
import * as JGMath from "@jgtools/jgmath";
// or import functions individually
import { getAngle } from "@jgtools/jgmath";
// ...
```
### Using cdn
```html
// import all functions using a namespace
import * as JGMath from "https://cdn.jsdelivr.net/npm/@jgtools/jgmath@1.0.7/dist/index.min.js";
// or import functions individually
import { getAngle } from "https://cdn.jsdelivr.net/npm/@jgtools/jgmath@1.0.7/dist/index.min.js";
// ...
```
## Usage
```javascript
import { getAngle } from "@jgtools/jgmath";
const p1 = { x: 1, y: 2 };
const p2 = { x: 5, y: 5 };
const a = getAngle(p1, p2);
```
## License
MIT