0.1.6 • Published 7 years ago

coordinates v0.1.6

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

coordinates Build Status

Calculate relative coordinates

Install

npm install --save coordinates

Usage

import coordinates from 'coordinates';

coordinates({ x: 100, y: 100 }); // { x: 100, y: 100, r: 141.421, fi: 0.785 }
coordinates({ x: 50, y: 100 }, { x: 100, y: 100 }); // { x: -50, y: 0, r: 50, fi: 3.146 }

API

coordinates(point, origin)

Return relative coordinates in Cartesian and polar coordinate systems.

point

Type: object

Point x, y coordinates.

origin

Type: object Default: { x: 0, y: 0 }

Origin x, y coordinates.

Related

License

MIT

0.1.6

7 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

9 years ago