Socket
Book a DemoInstallSign in
Socket

robust-point-in-simplex

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

robust-point-in-simplex

Exact geometric predicate to classify a point against a simplex

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
4
-50%
Maintainers
1
Weekly downloads
 
Created
Source

robust-point-in-simplex

Exact point in simplex predicate.

Example

var pointInSimplex = require("robust-point-in-simplex")

var simplex = [
  [0,0],
  [0,1],
  [1,0]
]

console.log(pointInSimplex(simplex, [0.25, 0.25]))

require("robust-point-in-simplex")(simplex, point)

Exactly tests if a given point is contained in a simplex.

  • simplex is an array of n+1 points
  • point is a length n array of floats

Returns An integer indicating where the point lies on the simplex

  • >0 if the point is contained in the simplex
  • <0 if the point is outside the simplex
  • 0 if the point lies on the boundary of the simplex

Credits

(c) 2013 Mikola Lysenko. MIT License

Keywords

simplex

FAQs

Package last updated on 07 May 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