StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
StackGenVis/frontend/node_modules/robust-orientation/test/test.js

111 lines
1.5 KiB

4 years ago
"use strict"
var tape = require("tape")
var orientation = require("../orientation.js")
tape("2d orientation", function(t) {
t.equals(orientation(
[0.1, 0.1],
[0.1, 0.1],
[0.3, 0.7]
), 0)
t.ok(orientation(
[0,0],
[-1e-64,0],
[0,1]
)>0)
t.equals(orientation(
[0,0],
[1e-64,1e-64],
[1,1]
), 0)
t.ok(orientation(
[0,0],
[1e-64,0],
[0,1]
)<0)
var x = 1e-64
for(var i=0; i<200; ++i) {
t.ok(orientation(
[-x, 0],
[0, 1],
[x, 0]
)>0)
t.equals(orientation(
[-x, 0],
[0, 0],
[x, 0]
), 0)
t.ok(orientation(
[-x, 0],
[0, -1],
[x, 0]
)<0, "x=" + x)
t.ok(orientation(
[0, 1],
[0, 0],
[x, x]
)<0, "x=" + x)
x *= 10
}
t.end()
})
tape("3d orientation", function(t) {
t.ok(orientation(
[0, 0, 0],
[1, 0, 0],
[0, 1, 0],
[0, 0, 1]
) < 0)
t.ok(orientation(
[0, 0, 0],
[1, 0, 0],
[0, 0, 1],
[0, 1, 0]
) > 0)
t.ok(orientation(
[0, 0, 0],
[1e-64, 0, 0],
[0, 0, 1],
[0, 1e64, 0]
) > 0)
t.end()
})
tape("4d orientation", function(t) {
t.ok(orientation(
[0,0,0,0],
[1,0,0,0],
[0,1,0,0],
[0,0,1,0],
[0,0,0,1]
) > 0)
t.end()
})
tape("5d orientation", function(t) {
t.ok(orientation(
[0,0,0,0,0],
[1,0,0,0,0],
[0,1,0,0,0],
[0,0,1,0,0],
[0,0,0,1,0],
[0,0,0,0,1]
) > 0)
t.end()
})