# do-line-segments-cross

> Calculate if two line segments on a 2D plane cross each other

Latest version **1.0.0** (published 2018-03-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install do-line-segments-cross
pnpm add do-line-segments-cross
yarn add do-line-segments-cross
bun add do-line-segments-cross
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-03-20 |
| First published | 2018-03-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Chen Ofek |
| Maintainers | jeevandark |
| Keywords | line, lines, segments, cross |

## Links

- npm: https://www.npmjs.com/package/do-line-segments-cross
- Repository: https://github.com/jeevandark/do-line-segments-cross
- Homepage: https://github.com/jeevandark/do-line-segments-cross#readme
- Issues: https://github.com/jeevandark/do-line-segments-cross/issues
- npm.io page: https://npm.io/package/do-line-segments-cross

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2018-03-20

## README

# do-line-segments-cross

A Node.js package that calculates if two given line segments (passed as four points) cross each other.

`doLineSegmentsCross(p1, q1, p2, q2)` where each parameter should have `x` and `y` properties properly set.

p1 & q1 are the coordinates that define the first line, and p2 & q2 are the coordinates that define the second line.

## Usage

First, install the package using npm:

    npm install do-line-segments-cross --save

Then, require the package and use it like so:

    var doLineSegmentsCross = require('do-line-segments-cross');

    console.log({x: 1, y: 1}, {x: 6, y: 6}, {x: 6, y: 6}, {x: 1, y: 1});    // true
    console.log({x: 1, y: 1}, {x: 6, y: 6}, {x: 2, y: 1}, {x: 7, y: 6});    // false

## License

MIT

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