A collection of mathematical formulas.
npm install @gottheflag/formulaimport { add, distance } from "@gottheflag/formula/geometry";
import { DEG_TO_RAD } from "@gottheflag/formula/trigonometry";
import { voltage } from "@gottheflag/formula/engineering";
// Geometry
const a = { x: 10, y: 5 };
const b = { x: 20, y: 30 };
add(a, b); // { x: 30, y: 35 }
distance(a, b); // 26.92582403567252
// Trigonometry
180 * DEG_TO_RAD; // 3.141592653589793
// Engineering
voltage(2, 100); // 200