repo.or.cz
/
liba.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
release 0.1.15
[liba.git]
/
quickjs
/
test
/
trajpoly3.js
blob
70b15a5e198fcc23fb8d0c98ddcbf78914193af7
1
import * as a from "liba.so";
2
function assert(expr) {
3
if (!eval(expr)) {
4
throw Error(expr);
5
}
6
}
7
var ctx = new a.trajpoly3(1, 0, 1);
8
ctx.gen(10, 0, 10, 0, 0);
9
assert("ctx.p");
10
assert("ctx.v");
11
assert("ctx.a");
12
for (var i = 0; i < 10; i += 0.1) {
13
console.log(i, ctx.pos(i), ctx.vel(i), ctx.acc(i));
14
}