angle-deviation-from-north

1.0.0 • Public • Published

angle-deviation-from-north

Greenkeeper badge

Determines the clockwise angle deviation from the North direction.

The implementation uses the Rhumb line algorithm which is efficient and accurate for short distances.

Install

$ npm install --save angle-deviation-from-north

Usage

const determineAngleDeviationFromNorth = require('angle-deviation-from-north');
 
const from = { latitude: 59.45337, longitude: 18.5579 };
const to = { latitude: 59.45337, longitude: 18.5569 };
 
determineAngleDeviationFromNorth(from, to);
//=> 270

API

determineAngleDeviationFromNorth(fromPosition, toPosition)

Gives the heading of the line from one position to another.

For example, if you draw an arrow from fromPosition to toPosition then the arrow will have the heading returned by this function.

The returned angle is in degrees and can be [0.0, 360.0), greater than or equal 0 and less than 360.

The two positions must have the properties latitude and longitude.

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i angle-deviation-from-north

    Weekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • dbrockman