Socket
Socket
Sign inDemoInstall

frechet

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

frechet


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
5.89 kB
Created
Weekly downloads
 

Readme

Source

frechet

Calculates the discrete Fréchet distance of two polylines.

The Fréchet distance is a distance metric that represents the similarity of two curves. A way to think about it is to imagine a person walking along the first curve and a dog walking along the second curve. The Fréchet distance represents the shortest leash required to complete the walk without backtracking.

Installation

The library is available on npm. Install with the following command:

npm install frechet

Usage

var frechet = require('frechet');

var l1 = [[0, 0], [1, 1], [2, 2]];
var l2 = [[1, 1], [2, 2], [3, 3]];

console.log(frechet(l1, l1)); // 0
console.log(frechet(l1, l2)); // 1

Building the library

The library is packaged using rollup.js. To build use the following command:

npm install
rollup -c

The result is available in [dist/index.js].

Running the tests

Run the tests like this:

npm install
npm test

Keywords

FAQs

Last updated on 21 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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc