# Closest Pair of Points Algorithm

The Closest Pair of Points algorithm is used to find the two points in a set that are closest to each other in terms of Euclidean distance. It is a fundamental problem in computational geometry and has various applications in computational geometry and computational biology.

## Usage

To use the Closest Pair of Points algorithm in your JavaScript project, you can follow these steps:

1. Import the `ClosestPairOfPoints` class.

```javascript
const ClosestPairOfPoints = require('adv-dsa').ClosestPairOfPoints;
```

2. Use the `findClosestPair` static method to find the closest pair of points in a given array of points.

```javascript
const points = [
    { x: 0, y: 0 },
    { x: 2, y: 2 },
    { x: 5, y: 3 },
    { x: 6, y: 7 },
    { x: 7, y: 8 },
    { x: 9, y: 1 },
];

const closestPair = ClosestPairOfPoints.findClosestPair(points);
console.log('The closest pair of points is:', closestPair);
```

## Example

```javascript
const ClosestPairOfPoints = require('adv-dsa').ClosestPairOfPoints;

const points = [
    { x: 0, y: 0 },
    { x: 2, y: 2 },
    { x: 5, y: 3 },
    { x: 6, y: 7 },
    { x: 7, y: 8 },
    { x: 9, y: 1 },
];

const closestPair = ClosestPairOfPoints.findClosestPair(points);
console.log('The closest pair of points is:', closestPair);
```

This code will output the closest pair of points:

```
The closest pair of points is: [ { x: 6, y: 7 }, { x: 7, y: 8 } ]
```

## Test Cases

You can also use the provided test cases to verify that the `ClosestPairOfPoints` class works as expected. Here's how you can run the test cases:

1. Import the `ClosestPairOfPoints` class in your test file.

```javascript
const ClosestPairOfPoints = require('adv-dsa').ClosestPairOfPoints;
```

2. Use the `expect` function from your testing framework to assert the results of the `findClosestPair` method.

```javascript
// Example test case
const points = [
    { x: 0, y: 0 },
    { x: 2, y: 2 },
    { x: 5, y: 3 },
    { x: 6, y: 7 },
    { x: 7, y: 8 },
    { x: 9, y: 1 },
];
expect(ClosestPairOfPoints.findClosestPair(points)).toEqual([{ x: 6, y: 7 }, { x: 7, y: 8 }]);
```

Make sure to run your test suite to validate the correctness of the Closest Pair of Points algorithm implementation.
