Skip to content

Latest commit

 

History

History
43 lines (26 loc) · 1.05 KB

GEOMETRY.md

File metadata and controls

43 lines (26 loc) · 1.05 KB

Javascipt Geometry Utilities

K2 Javascript Utilities offers several utilities packages. The geometry package privide several methods to to support geometric calculations.

Install

npm install @k2_tools/utils

Import

import {geomtery} from "@k2_tools/utils";

Usage

K2_tools geometry utilities offers a the following geometric calculations support functions.

  1. deg2rad
  2. rad2deg
  3. polar2cartesian
  4. cartesian2polar

deg2rad

The deg2rad(degrees) method accepts a number of degrees as its argument and returns the angle in radians

deg2rad

The rad2deg(radians) method accepts a number of radians as its argument and returns the angle in degrees

polar2cartesian

The polar2cartesian(radius, deg) method accepts a radius and number of degrees as its argument and returns the same as a cartesian co-ordinate {x : number, y : nunber}

cartesian2polar

The cartesian2polar(x, y) method accepts a cartesian point as x and y and returns the same as a polar co-ordinate {radius : nuber, deg : number}