A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/mikolalysenko/robust-in-sphere below:

mikolalysenko/robust-in-sphere: Exact arithmetic test to check if (n+2) points are cospherical

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.

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

console.log(inSphere(
  [0, 1],
  [1, 0],
  [-1, 0],
  [0, -1]))
npm install robust-in-sphere
var inSphere = require("robust-in-sphere")

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.

Returns A signed integer that gives the orientation of the points

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)

(c) 2014 Mikola Lysenko. MIT License


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4