Socket
Socket
Sign inDemoInstall

point-in-triangle

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

point-in-triangle

test whether a point is inside a triangle


Version published
Maintainers
1
Created
Source

point-in-triangle

stable

Test whether a point is inside a triangle, using barycentric coordinates and this algorithm from BlackPawn.

var inside = require('point-in-triangle')

var triangle = [ [25, 10], [100, 250], [40, 40] ]
console.log(inside([25, 25], triangle))

You may also be interested in:

Usage

NPM

inside(point, triangle)

Returns true if the point [x, y] is inside the triangle [ [x1,y1], [x2,y2], [x3,y3] ], false otherwise.

License

MIT, see LICENSE.md for details.

Keywords

FAQs

Package last updated on 02 Nov 2014

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