1.1.1 • Published 4 years ago

rad-deg-converter v1.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

rad-deg-converter

Discord npm NPM npm

Simple JS library to convert degrees to radians or conversely from radians to degrees

Install

npm i rad-deg-converter

API

  • Constructor

Conversion

  • Functions

.toDeg () .toRad ()

Usage

The one and only constructor that composes this library returns a callback function that takes the value of the angle as a parameter

const {
    Conversion
} = require ('rad-deg-converter');

new Conversion ('25deg', (value) => {
    console.log (value.this.toRad ());

    // Expected output: 0.4363323129985824
});

new Conversion ('2rad', (value) => {
    console.log (value.this.toDeg ());

    // Expected output: 114.59155902616465
});