# gintersect

> Finds intersection between two lines

Latest version **0.1.0** (published 2015-01-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install gintersect
pnpm add gintersect
yarn add gintersect
bun add gintersect
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2015-01-15 |
| First published | 2015-01-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Andrei Kashcha |
| Maintainers | anvaka |
| Keywords | geometry, intersect, lines |

## Links

- npm: https://www.npmjs.com/package/gintersect
- Repository: https://github.com/anvaka/gintersect
- Issues: https://github.com/anvaka/gintersect/issues
- npm.io page: https://npm.io/package/gintersect

## Recent versions

- 0.1.0 (latest) — 2015-01-15

## README

# gintersect

Finds intersection between two lines. This is JavaScript adaptation of Mukesh
Prasad's work from [Grapchis Gem II](http://www.opensource.apple.com/source/graphviz/graphviz-498/graphviz/dynagraph/common/xlines.c)
book. It is supposed to be very fast.

[![Build Status](https://travis-ci.org/anvaka/gintersect.svg)](https://travis-ci.org/anvaka/gintersect)
# usage

``` javascript
var intersect = require('gintersect');
var intersection = intersect(
  // first segment
  -1, 1, // start
  1, -1, // end
  // second segment
  -1, -1, // start
  1, 1 // end
);
console.log(intersection);
// prints {x: 0, y: 0} - intersection point of two segments
```

If no intersection found return value is falsy:

``` javascript
var parallel = intersect(
  // first segment
  0, 1, // start
  0, 2, // end
  // second segment
  1, 1, // start
  1, 2 // end
);
console.log(parallel);
// prints null - two parallel segments do not intersect.
```

# install

With [npm](https://npmjs.org) do:

```
npm install gintersect
```

# license

MIT

---
_Source: https://npm.io/package/gintersect · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
