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

robust-predicates

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

robust-predicates

Fast robust predicates for computational geometry

  • 2.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.6M
decreased by-55.53%
Maintainers
1
Weekly downloads
 
Created

What is robust-predicates?

The robust-predicates package provides robust geometric predicates that are used to perform orientation and incircle tests on 2D and 3D points. These predicates are designed to return exact results, which is crucial in computational geometry to avoid errors due to floating-point arithmetic.

What are robust-predicates's main functionalities?

Orientation tests

This feature allows you to determine the orientation of three points in 2D space. The function returns a positive value if the points are in counterclockwise order, zero if they are collinear, and a negative value if they are in clockwise order.

const rp = require('robust-predicates');
const result = rp.orient2d([0, 0], [1, 1], [1, 0]);
console.log(result); // Outputs a positive or negative value indicating the orientation

Incircle tests

This feature checks whether a point is inside, on the edge, or outside the circle defined by three other points in 2D space. The function returns a positive value if the point is inside, zero if on the circle, and a negative value if outside.

const rp = require('robust-predicates');
const result = rp.incircle([0, 0], [1, 0], [0, 1], [1, 1]);
console.log(result); // Outputs a positive, zero, or negative value based on the point's position relative to the circle
0

Keywords

FAQs

Package last updated on 10 Sep 2019

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