open-index/open-npm huggingface dataset:
npm package: @lgs-code/2d-geometry
Description: TypeScript library for 2d geometry
Author: LGS
Latest version: 1.1.0

# 2d-geometry

2d-geometry is a (yet another) library providing a bunch of classes and geometry operations in 2d space.

The main concern behind this library is to aggregate at some point, as many neat computational features that we can do for basic shapes in 2d space as possible.

This library is not intented to be used as-is, but more as a toolkit in your own applications.

## How to use it

For example, image you'd like to get the area of a circle, you could use the following code :

    import { Circle2d, Point2d }  from "@lgs-code/2d-geometry"; 

    const circle = new Circle2d(new Point2d(10, 10), 33);

    // will output 3421.19
    console.log(circle.area);

Another example could be you'd like to get intersection points between an ellipse and a rectangle, you could use the following code :

    import { Rect2d, Ellipse2d }  from "@lgs-code/2d-geometry"; 

    const rect = new Rect2d(new Point2d(0, 0), 150, 30);
    const ellipse = new Ellipse2d(new Point2d(20, 10), 100, 60);

    // will output [ Point2d { x: 67.14, y: 0 }, Point2d { x: 57.27, y: 30 } ]
    const intersections = rect.getIntersectionPoints(ellipse);

Fairly simple, right?

## Documentation

For the list of of available classes and features, please review the documentation [here](https://lgs-code.github.io/2d-geometry/).

## Tools

The tools used in this library are :

- [TypeScript](https://www.typescriptlang.org/) => mostly for configuring compiler options
- [ESLint](https://eslint.org/docs/latest/) => code rules and formatters
- [Prettier](https://prettier.io/) => code formatting rules
- [Rollup](https://rollupjs.org/) => to create bundles in various format like UMD, Common Js and ES Modules
- [Jest]() => writing and executing unit tests
- [TypeDoc](https://typedoc.org/) => generating the documentation

## Contribution

Feel free to contribute by adding new features or shapes :)
npm package: @lgs-code/colorimetry
Description: TypeScript library for color conversion
Author: LGS
Latest version: 1.0.0

# colorimetry

TypeScript library for color conversion between multiple formats.

## Usage

This library supports the following formats :

- (s)RGB
- HSL
- HSB (or HSV)
- CMYK
- YUV (BT.470, BT.601, BT.709 profiles)
- CIE XYZ

### Converters

To convert from a format to another, you can use the appropriate "converter" to do so :

- RgbConverter,
- HslConverter,
- HsbConverter,
- CmykConverter,
- YuvConverter,
- CieXyzConverter

These are not classes, but namespaces regrouping conversion functions.

### Quick example: (s)RGB to HSB

Image you'd like to convert a RGB value to HSB, you can use the following code:

    import { Rgb, RgbConverter } from "@lgs-code/colorimetry";

    const rgb = new Rgb(252, 186, 3);
    const hsb = RgbConverter.RgbToHsb(rgb);

    // will output "44.10°, 98.81%, 98.82%"
    console.log(`${hsb.h.toFixed(2)}°, ${(hsb.s * 100).toFixed(2)}%, ${(hsb.b * 100).toFixed(2)}%`);

The same principle apply to any conversion you'd like to perform.

## Documentation

For the list of of available classes and features, please review the documentation [here](https://lgs-code.github.io/colorimetry/).

## Tools

The tools used in this library are :

- [TypeScript](https://www.typescriptlang.org/) => mostly for configuring compiler options
- [ESLint](https://eslint.org/docs/latest/) => code rules and formatters
- [Prettier](https://prettier.io/) => code formatting rules
- [Rollup](https://rollupjs.org/) => to create bundles in various format like UMD, Common Js and ES Modules
- [Jest]() => writing and executing unit tests
- [TypeDoc](https://typedoc.org/) => generating the documentation

## Contribution

Feel free to contribute by adding new features or color formats :)