Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

maidenhead

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

maidenhead

The Maidenhead Locator System is a geographic co-ordinate system used by amateur radio operators. Based on Michael Graff's maidenhead gem

  • 1.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Maidenhead

The Maidenhead Locator System is a geographic co-ordinate system used by amateur radio operators.

Based on Michael Graff's maidenhead gem

    var Maidenhead = require('maidenhead');

    var latitude  = 50.879087; //mandatory
    var longitude = 4.701169;  //mandatory
    var precision = 6;         //optional defaults to 5
 
    var townHall     = new Maidenhead(latitude, longitude, precision);
    var trainStation = new Maidenhead(50.881264, 4.715634, 6);
    var library      = new Maidenhead(); 
    
    library.locator  = 'JO20iu16ti';

    var maidenheadLocator = townHall.locator;
    console.log('has valid locator: ' + Maidenhead.valid(maidenheadLocator));
     
    console.log("latitude: %s, longitude: %s, Maidenhead: %s", townHall.lat, townHall.lon, maidenheadLocator);
    console.log("[lat, lon] = ", Maidenhead.toLatLon(maidenheadLocator));
    
    console.log("distance to train station in M from town hall: %s", townHall.distanceTo(trainStation, 'm'));
    console.log("bearing to library station from town hall: %s degrees", townHall.bearingTo(library));
    console.log("compass bearing to library station from town hall: %s ", townHall.bearingTo(library, true));
    

Keywords

FAQs

Package last updated on 23 Feb 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc