Skip to content

Latest commit

 

History

History
38 lines (23 loc) · 588 Bytes

File metadata and controls

38 lines (23 loc) · 588 Bytes

Formula

A collection of mathematical formulas.

Installation

npm install @gottheflag/formula

Usage

import { 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

License

Apache-2.0