repo.or.cz
/
liba.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
release 0.1.13
[liba.git]
/
quickjs
/
test
/
trajpoly5.js
blob
709c3da846c464d2ba30ee20b9a27de6db71aa08
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
.
trajpoly5
(
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
}