@ilihub/right-triangle
v1.0.4
Published
A collection of useful TypeScript functions and utilities for performing Right Triangle calculations.
Downloads
7
Maintainers
Readme
@ilihub/right-triangle
A collection of useful TypeScript functions and utilities for performing calculations on right triangle.
Installation
# if you're using pnpm
pnpm add @ilihub/right-triangle
# or, if you're using npm
npm install @ilihub/right-triangle
# or, if you're using yarn
yarn add @ilihub/right-triangle
Usage
import { RightTriangle } from "@ilihub/right-triangle";
const base = 6;
const height = 5;
const rightTriangle = new RightTriangle(base, height);
const area = rightTriangle.area();
console.log(area); // 15
const perimeter = rightTriangle.perimeter();
console.log(perimeter); // 18.810249675906654
Sponsors & Backers
Support the development of new open-source projects from ilihub through crowdfunding.
The core of ilihub is our crowd-funded open-source projects, licensed under the permissive MIT license. Sponsorship increases the rate of bug fixes, documentation improvements, and feature development.