GithubHelp home page GithubHelp logo

mikolalysenko / robust-point-in-simplex Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 152 KB

Exact geometric predicate to test if a point is contained in a simplex

License: MIT License

JavaScript 100.00%

robust-point-in-simplex's Introduction

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

robust-point-in-simplex's People

Contributors

mikolalysenko avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.