apollonius
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -11,4 +11,7 @@ // Type definitions of apollonius library | ||
declare function apollonius(c1: Circle2, c2: Circle2, c3: Circle2): Circle2 | null; | ||
interface Options { | ||
epsilon: number; | ||
} | ||
export = apollonius; | ||
export default function apollonius(c1: Circle2, c2: Circle2, c3: Circle2): Circle2 | null; | ||
export const options: Options; |
12
index.js
@@ -1,2 +0,5 @@ | ||
const epsilon = 0.0000000001 // epsilon from affineplane | ||
const defaultEpsilon = 0.0000000001 // precision from affineplane | ||
const libOptions = { | ||
epsilon: defaultEpsilon // keep epsilon modifiable | ||
} | ||
@@ -17,2 +20,3 @@ const bitangent = (c1, c2) => { | ||
const d = Math.sqrt(dx * dx + dy * dy) | ||
const epsilon = libOptions.epsilon | ||
@@ -78,2 +82,4 @@ if (d < epsilon) { | ||
const epsilon = libOptions.epsilon | ||
// First we handle the cases where the circle centers are equal. | ||
@@ -141,3 +147,3 @@ // In these case a solution can be found only when the radii of the circles are equal. | ||
const apollonius = function (c1, c2, c3) { | ||
export function apollonius (c1, c2, c3) { | ||
// Find a circle that is externally tangent to the three circles c1,c2,c3. | ||
@@ -158,2 +164,3 @@ // If no such circle exists on the real plane, return null. | ||
// | ||
const epsilon = libOptions.epsilon | ||
@@ -214,1 +221,2 @@ // Circle differences | ||
export default apollonius | ||
export const options = libOptions |
{ | ||
"name": "apollonius", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Solves Apollonius' problem by finding a fourth circle tangent to three given circles", | ||
"type": "module", | ||
"main": "./index.js", | ||
"exports": "./index.js", | ||
@@ -7,0 +8,0 @@ "types": "./index.d.ts", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13824
219