New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

compass-direction-to-heading

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

compass-direction-to-heading

A simple JavaScript helper to convert a 16-wind compass direction to a degrees heading

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

Compass Direction To Heading

A simple JavaScript helper to convert a 16-wind compass direction to a degrees heading typically used in aviation.

Example Usage

import compassToHeading from 'compass-direction-to-heading';

const heading = compassToHeading('NNW'); // Returns int 338

console.log(heading); // 338

Installation

NPM

npm i compass-direction-to-heading

Docs

The helper function accepts a string (any case) containing one of the 16 point values:

Compass DirectionHeading Returned
N360
NNE23
NE45
ENE68
E90
ESE113
SE135
SSE158
S180
SSW203
SW225
WSW248
W270
WNW293
NW315
NNW338

Heading values are based on 16 points at 22.5deg and rounded up

Keywords

heading

FAQs

Package last updated on 21 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts