0.0.6 • Published 5 months ago

triplesun-2d-geometry v0.0.6

Weekly downloads
-
License
-
Repository
github
Last release
5 months ago

Geometry

A library for creation and manipulation of basic 2-dimensional geometric shapes

Install

npm install @triplesun/geometry

Usage

const { Shape } = Geometry

  • Shape is a class that creates a shape based on required dimesions

Returns shape that has methods .clone() .multiply() .area .diameter .perimeter

  • .clone() and .multiply() return new shape instance based on an existing one
  • .area, .diameter and .perimeter calculate an area, diameter and perimeter of a shape
  • any shape constructor also accepts floating point decimals limit as a last argument

Example

import {
  Circle,
  Polygon,
  Rectangle,
  Square,
  Triangle,
} from "@triplesun/geometry";

const circle = new Circle(123, 0);
console.log(circle.area);

Output

47529;
0.0.6

5 months ago

0.0.5

5 months ago

0.0.4

5 months ago

0.0.3

5 months ago

0.0.2

5 months ago

0.0.1

5 months ago