<commit_before>chebyshev-distance
===
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependencies][dependencies-image]][dependencies-url]

> Computes the [Chebyshev distance](http://en.wikipedia.org/wiki/Chebyshev_distance) between two sequences


## Installation

``` bash
$ npm install compute-chebyshev-distance
```

For use in the browser, use [browserify](https://github.com/substack/node-browserify).


## Usage

``` javascript
var chebyshev = require( 'compute-chebyshev-distance' );
```

#### chebyshev( x, y[, accessor] )

Computes the [Chebyshev distance](http://en.wikipedia.org/wiki/Chebyshev_distance) between two arrays `x` and `y` of equal length, defined as

<div align="center">
	<img src="https://github.com/compute-io/chebyshev-distance/blob/master/docs/img/eqn.png" alt="Formula of Chebyshev Distance" height="96px">
	<br>
</div>

``` javascript

var x = [ 1, 3, 7, 4 ],
	y = [ 2, 4, 6, -4 ];

var dist = chebyshev( x, y );
// returns 8
```

The chebyshev distance is equal to the [Minkowski distance](http://en.wikipedia.org/wiki/Minkowski_distance) in the limiting case when `p` goes to infinity.

To compute the [Chebyshev distance](http://en.wikipedia.org/wiki/Chebyshev_distance) between nested `array` values, provide an accessor `function` for accessing `numeric` values.

``` javascript<commit_msg>[FIX] eqn size<commit_after>chebyshev-distance
===
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependencies][dependencies-image]][dependencies-url]

> Computes the [Chebyshev distance](http://en.wikipedia.org/wiki/Chebyshev_distance) between two arrays


## Installation

``` bash
$ npm install compute-chebyshev-distance
```

For use in the browser, use [browserify](https://github.com/substack/node-browserify).


## Usage

``` javascript
var chebyshev = require( 'compute-chebyshev-distance' );
```

#### chebyshev( x, y[, accessor] )

Computes the [Chebyshev distance](http://en.wikipedia.org/wiki/Chebyshev_distance) between two arrays `x` and `y` of equal length, defined as

<div align="center">
	<img src="https://github.com/compute-io/chebyshev-distance/blob/master/docs/img/eqn.png" alt="Formula of Chebyshev Distance" height="32px">
	<br>
</div>

``` javascript

var x = [ 1, 3, 7, 4 ],
	y = [ 2, 4, 6, -4 ];

var dist = chebyshev( x, y );
// returns 8
```

The chebyshev distance is equal to the [Minkowski distance](http://en.wikipedia.org/wiki/Minkowski_distance) in the limiting case when `p` goes to infinity.

To compute the [Chebyshev distance](http://en.wikipedia.org/wiki/Chebyshev_distance) between nested `array` values, provide an accessor `function` for accessing `numeric` values.

``` javascript
{'fraction_non_alphanumeric': 0.1618374558303887, 'fraction_numerical': 0.0077738515901060075, 'mean_word_length': 5.249448123620309, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3557985', 'n_tokens_mistral': 1054, 'n_tokens_neox': 920, 'n_words': 237}