robust-in-sphere

WebJar for robust-in-sphere

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

robust-in-sphere
Last Version

Last Version

1.1.3
Release Date

Release Date

Type

Type

jar
Description

Description

robust-in-sphere
WebJar for robust-in-sphere
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/mikolalysenko/robust-in-sphere

Download robust-in-sphere

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/robust-in-sphere/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>robust-in-sphere</artifactId>
    <version>1.1.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/robust-in-sphere/
implementation 'org.webjars.npm:robust-in-sphere:1.1.3'
// https://jarcasting.com/artifacts/org.webjars.npm/robust-in-sphere/
implementation ("org.webjars.npm:robust-in-sphere:1.1.3")
'org.webjars.npm:robust-in-sphere:jar:1.1.3'
<dependency org="org.webjars.npm" name="robust-in-sphere" rev="1.1.3">
  <artifact name="robust-in-sphere" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='robust-in-sphere', version='1.1.3')
)
libraryDependencies += "org.webjars.npm" % "robust-in-sphere" % "1.1.3"
[org.webjars.npm/robust-in-sphere "1.1.3"]

Dependencies

compile (4)

Group / Artifact Type Version
org.webjars.npm : robust-scale jar [1.0.0,2)
org.webjars.npm : robust-sum jar [1.0.0,2)
org.webjars.npm : two-product jar [1.0.0,2)
org.webjars.npm : robust-subtract jar [1.0.0,2)

Project Modules

There are no modules declared in this project.

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

Versions

Version
1.1.3