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

frechet

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

frechet

Calculate Discrete Frechet Distance.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
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

Package 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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc