1 import * as a from "liba.so";
2 function assert(expr, info) {
4 throw Error("assertion failed: " + info);
8 assert(a.mf.GAUSS == 1);
9 assert(a.mf.GAUSS2 == 2);
10 assert(a.mf.GBELL == 3);
11 assert(a.mf.SIG == 4);
12 assert(a.mf.DSIG == 5);
13 assert(a.mf.PSIG == 6);
14 assert(a.mf.TRAP == 7);
15 assert(a.mf.TRI == 8);
16 assert(a.mf.LINS == 9);
17 assert(a.mf.LINZ == 10);
20 assert(a.mf.PI == 13);
21 for (var i = -1; i < 1; i += 0.1) {
24 a.mf.gauss2(i, 1, -1, 1, 1),
25 a.mf.gbell(i, 2, 1, 0),
27 a.mf.dsig(i, 5, -2, 5, 2),
28 a.mf.psig(i, 5, -2, -5, 2),
29 a.mf.trap(i, -2, -1, 1, 2),
30 a.mf.tri(i, -1, 0, 1),
35 a.mf.pi(i, -2, -1, 1, 2)