# pointcirclecollision

> test for collision with a circle and point

Latest version **1.0.5** (published 2017-08-12) · MIT license · 0 weekly downloads

## Install

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

## 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.5 |
| Published | 2017-08-12 |
| First published | 2017-08-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Philip Bell |
| Maintainers | philipbell |

## Links

- npm: https://www.npmjs.com/package/pointcirclecollision
- Repository: https://github.com/processprocess/circlepointcollision
- Homepage: https://github.com/processprocess/circlepointcollision#readme
- Issues: https://github.com/processprocess/circlepointcollision/issues
- npm.io page: https://npm.io/package/pointcirclecollision

## Recent versions

- 1.0.5 (latest) — 2017-08-12
- 1.0.4 — 2017-08-12
- 1.0.3 — 2017-08-12

## README

# pointCircleCollision

Performs a point-circle collision test, returning true if they collide. Inspired from Matt Desl's point-circle-collision [point-circle-collision](http://github.com/mattdesl/point-circle-collision/blob/master/LICENSE.md) node.

```js
const collision = require('./pointCircleCollision.js');

let p = {
  x: 100,
  y: 100
}

let c = {
  x: 120,
  y: 120,
  radius: 100
}

let hit = collision(p.x, p.y, c.x, c.y, c.radius);
console.log(hit);
```

## Usage

### `pointCircleCollision(pointX, pointY, circleX, circleY, circleRadius)`

Performs a collision test with the given parameters. Returns true if collision occurred.

Expects the x and y coordinates for the point and circle, and the circle's radius.

If the radius is zero, this test will return false.

## License

MIT

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