release 0.1.9
[liba.git] / quickjs / test / trajpoly7.js
blobab901e8bcf22f8ba5a518be1629c32a2c69b86b3
1 import * as a from "liba.so";
2 function assert(expr) {
3 if (!eval(expr)) {
4 throw Error(expr);
7 var ctx = new a.trajpoly7(1, 0, 0);
8 ctx.gen(10, 0, 10, 0, 0);
9 assert("ctx.p");
10 assert("ctx.v");
11 assert("ctx.a");
12 assert("ctx.j");
13 for (var i = 0; i < 10; i += 0.1) {
14 console.log(i, ctx.pos(i), ctx.vel(i), ctx.acc(i), ctx.jer(0.5));