Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

check-point-in-rectangle

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

check-point-in-rectangle

Checks if point is in rectangle or not.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9
Maintainers
1
Weekly downloads
 
Created
Source

check-point-in-rectangle

Checks if point is in rectangle or not. This is based on the concept explained by Martin Thoma

installation

npm install check-point-in-rectangle

usage

var checkPointIn = require('check-point-in-rectangle');
checkPointIn(point, rectangle [,precision]) 

point array of x and y coordinates
rectangle array of four corner points
precision is used in algorithm to compare the area of rectangle and sum of triangles formed by point with rectangle, default is 6

example

var checkPoint = require('check-point-in-rectangle');
if (checkPoint([5,5],[[0,0], [10,0], [10,10], [0,10]]) == true) {
  console.log('Point is inside the rectangle');
}
```
  
## developing
Once you run
 
```npm isntall```

then for running test 

```npm run test```

to create build

```npm run build```

## license
This project is licensed under the terms of the MIT license.

Keywords

FAQs

Package last updated on 19 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc