npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

geodaisy

v0.1.0

Published

Library for geodesic functions

Downloads

1

Readme

🌎Geodaisy - simple geodesic utilities for NodeJS and Web

Get started

npm install geodaisy

Usage in JavaScript or TypeScript (typings are available):

Distance utilities - Haversine

Uses the Haversine Formula to calculate the distance between two earthly points of coordinates.

import { haversine } from 'geodaisy';

const atlanta = {
  latitude: 33.749,
  longitude: -84.388,
};

const london = {
  latitude: 51.5074,
  longitude: -0.1278,
};

const distance = haversine(
  atlanta.longitude,
  atlanta.latitude,
  london.longitude,
  london.latitude,
);

console.log(distance); // > 6769.949658450232

Distance utilities - distanceWithLatitude

Given a distance as a number (this formula does not care about units) and the distance between the elevation change between two points - calculates the real distance between the two points in a straight line, e.g.:

import { distanceWithLatitude } from 'geodaisy';

const distance = 13800; // m
const elevation = 1120; // m

const realDistance = distanceWithLatitude(distance, elevation);

console.log(realDistance); // > 13845.374678931588

Conversion utilities

The following conversion utilities are also available:

import {
  kmToMile,
  mileToKm,
  yardToMetre,
  metreToYard,
  inchToCm,
  cmToInch,
} from 'geodaisy';

console.log(kmToMile(1)); // > 0.621371
console.log(mileToKm(1)); // > 1.6093444978925633
console.log(yardToMetre(1)); // > 0.9144
console.log(metreToYard(1)); // > 1.0936132983377078
console.log(inchToCm(1)); // > 2.54
console.log(cmToInch(1)); // > 0.39370078740157477

Missing features

The following features I'd love to have in this library but just don't have the time to implement yet. If you'd like to help, feel free to contribute!

  • [ ] Bearing calculation
  • [ ] Destination point calculation
  • [ ] Intersection calculation
  • [ ] Path finding
  • [ ] Closest point to the poles
  • [ ] Rhumb lines
  • [ ] Vincenty's formula