dbrockman / angle-deviation-from-north

Determines the clockwise angle deviation from the North direction

Home Page:https://www.npmjs.com/package/angle-deviation-from-north

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

angle-deviation-from-north

Build Status

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.

About

Determines the clockwise angle deviation from the North direction

https://www.npmjs.com/package/angle-deviation-from-north

License:MIT License


Languages

Language:JavaScript 100.0%