liba 0.1.15
An algorithm library based on C/C++
Loading...
Searching...
No Matches
trajpoly3.h
Go to the documentation of this file.
1
7#ifndef LIBA_TRAJPOLY3_H
8#define LIBA_TRAJPOLY3_H
9
10#include "a.h"
11
18typedef struct a_trajpoly3 a_trajpoly3;
19
20#if !defined A_TRAJPOLY3
21#define A_TRAJPOLY3 3
22#endif /* A_TRAJPOLY3 */
23#if defined(__cplusplus)
24extern "C" {
25#endif /* __cplusplus */
26
46A_EXTERN void a_trajpoly3_gen(a_trajpoly3 *ctx, a_float ts,
47 a_float p0, a_float p1,
48 a_float v0, a_float v1);
49A_EXTERN void a_trajpoly3_gen0(a_trajpoly3 *ctx, a_float ts,
50 a_float p0, a_float p1,
51 a_float v0, a_float v1);
52#if defined(A_TRAJPOLY3) && (A_TRAJPOLY3 + 0 > 1)
53A_EXTERN void a_trajpoly3_gen1(a_trajpoly3 *ctx);
54#endif /* A_TRAJPOLY3 */
55#if defined(A_TRAJPOLY3) && (A_TRAJPOLY3 + 0 > 2)
56A_EXTERN void a_trajpoly3_gen2(a_trajpoly3 *ctx);
57#endif /* A_TRAJPOLY3 */
58
71
72#if defined(A_TRAJPOLY3) && (A_TRAJPOLY3 + 0 > 1)
85#endif /* A_TRAJPOLY3 */
86
87#if defined(A_TRAJPOLY3) && (A_TRAJPOLY3 + 0 > 2)
100#endif /* A_TRAJPOLY3 */
101
102#if defined(__cplusplus)
103} /* extern "C" */
104namespace a
105{
106typedef struct a_trajpoly3 trajpoly3;
107} /* namespace a */
108#endif /* __cplusplus */
109
121{
123#if defined(A_TRAJPOLY3) && (A_TRAJPOLY3 + 0 > 1)
125#endif /* A_TRAJPOLY3 */
126#if defined(A_TRAJPOLY3) && (A_TRAJPOLY3 + 0 > 2)
128#endif /* A_TRAJPOLY3 */
129#if defined(__cplusplus)
130 A_INLINE void gen(a_float ts, a_float p0, a_float p1,
131 a_float v0 = 0, a_float v1 = 0)
132 {
133 a_trajpoly3_gen(this, ts, p0, p1, v0, v1);
134 }
135 A_INLINE void gen0(a_float ts, a_float p0, a_float p1,
136 a_float v0 = 0, a_float v1 = 0)
137 {
138 a_trajpoly3_gen0(this, ts, p0, p1, v0, v1);
139 }
140 A_INLINE a_float pos(a_float x) const
141 {
142 return a_trajpoly3_pos(this, x);
143 }
144#if defined(A_TRAJPOLY3) && (A_TRAJPOLY3 + 0 > 1)
145 A_INLINE void gen1() { a_trajpoly3_gen1(this); }
146 A_INLINE a_float vel(a_float x) const
147 {
148 return a_trajpoly3_vel(this, x);
149 }
150#endif /* A_TRAJPOLY3 */
151#if defined(A_TRAJPOLY3) && (A_TRAJPOLY3 + 0 > 2)
152 A_INLINE void gen2() { a_trajpoly3_gen2(this); }
153 A_INLINE a_float acc(a_float x) const
154 {
155 return a_trajpoly3_acc(this, x);
156 }
157#endif /* A_TRAJPOLY3 */
158#endif /* __cplusplus */
159};
160
163#endif /* a/trajpoly3.h */
algorithm library
#define a_float
Definition a.h:785
double a_trajpoly3_acc(a_trajpoly3 const *ctx, double x)
calculate acceleration for cubic polynomial trajectory
double a_trajpoly3_vel(a_trajpoly3 const *ctx, double x)
calculate velocity for cubic polynomial trajectory
double a_trajpoly3_pos(a_trajpoly3 const *ctx, double x)
calculate position for cubic polynomial trajectory
void a_trajpoly3_gen(a_trajpoly3 *ctx, double ts, double p0, double p1, double v0, double v1)
generate for cubic polynomial trajectory
instance structure for cubic polynomial trajectory
Definition trajpoly3.h:121
double v[3]
coefficients of velocity
Definition trajpoly3.h:124
double p[4]
coefficients of position
Definition trajpoly3.h:122
double a[2]
coefficients of acceleration
Definition trajpoly3.h:127