rename dt to x
[liba.git] / test / trajpoly3.h
blob5b9a8778ba465892257e418f73d416cbbe068fc8
1 #define MAIN(x) trajpoly3##x
2 #include "test.h"
3 #include "a/trajpoly3.h"
5 int main(int argc, char *argv[]) // NOLINT(misc-definitions-in-headers)
7 int start = 1;
8 if (argc > 1)
10 char *endptr = A_NULL;
11 (void)strtonum(argv[1], &endptr);
12 if (argv[1] == endptr)
14 main_init(argc, argv, 1);
15 ++start;
19 a_float arg[6] = {0};
20 for (int i = start; i < argc; ++i)
22 arg[i - start] = strtonum(argv[i], A_NULL);
24 a_trajpoly3 ctx;
25 a_trajpoly3_gen(&ctx, arg[1] - arg[0], arg[2], arg[3], arg[4], arg[5]);
26 for (a_float x = arg[0], delta = (arg[1] - arg[0]) / 1000; x < arg[1]; x += delta) // NOLINT
28 debug(A_FLOAT_PRI("+", "f,") A_FLOAT_PRI("+", "f,") A_FLOAT_PRI("+", "f,") A_FLOAT_PRI("+", "f\n"),
29 x, a_trajpoly3_pos(&ctx, x), a_trajpoly3_vel(&ctx, x), a_trajpoly3_acc(&ctx, x));
32 #if defined(__cplusplus) && (__cplusplus > 201100L)
33 A_ASSERT_BUILD(std::is_pod<a_trajpoly3>::value);
34 #endif /* __cplusplus */
36 return 0;