Math utils
npm i @jgtools/jgmath
// import all functions using a namespace
import * as JGMath from "@jgtools/jgmath";
// or import functions individually
import { getAngle } from "@jgtools/jgmath";
// ...
<script type="module">
// 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";
// ...
</script>
import { getAngle } from "@jgtools/jgmath";
const p1 = { x: 1, y: 2 };
const p2 = { x: 5, y: 5 };
const a = getAngle(p1, p2);
MIT