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

robust-in-sphere

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

robust-in-sphere

Exact arithmetic test to check if point is contained in sphere

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
25K
decreased by-22.88%
Maintainers
1
Weekly downloads
 
Created
Source

robust-in-sphere

Exact arithmetic test to check if (n+2) points are cospherical.

(Very) loosely inspired by Jonathan Shewchuk's work on robust predicates. Currently not as fast, but pull requests are welcome.

testling badge

build status

Example

var inSphere = require("robust-in-sphere")

console.log(inSphere(
  [0, 1],
  [1, 0],
  [-1, 0],
  [0, -1]))

Install

npm install robust-in-sphere

API

var inSphere = require("robust-in-sphere")

inSphere(a,b,c,...)

Tests if a collection of n+2 points in n-dimensional space are cospherical or if the last point is contained in the sphere or not.

  • a,b,c,... is a list of points

Returns A signed integer that gives the orientation of the points

  • <0 if the last point is contained in the oriented sphere defined by the previous two points
  • >0 if the last point is outside the sphere
  • 0 is the points are cospherical

Notes Up to 6 points it is possible to get a specialized version of inSphere that avoids an extra dispatch using the syntax:

inSphere[4](a,b,c,d) === inSphere(a,b,c,d)

Credits

(c) 2014 Mikola Lysenko. MIT License

Keywords

FAQs

Package last updated on 04 Aug 2021

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