diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2019-11-01 22:53:00 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2019-11-21 13:17:45 -0500 |
commit | a28b29993ad76a1beb7be4206f62c5694ede2248 (patch) | |
tree | 3bae1e4e2a1e6a762b1748b453e9f80d8b7772e8 /klippy/chelper/trapq.h | |
parent | d00023f3bbdf3c1d2b63a89612c46993112c2162 (diff) | |
download | kutter-a28b29993ad76a1beb7be4206f62c5694ede2248.tar.gz kutter-a28b29993ad76a1beb7be4206f62c5694ede2248.tar.xz kutter-a28b29993ad76a1beb7be4206f62c5694ede2248.zip |
trapq: Add code to calculate definitive integral
Support calculating the definitive integral of a cartesian axis
position over a time range of the movement queue.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/chelper/trapq.h')
-rw-r--r-- | klippy/chelper/trapq.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/klippy/chelper/trapq.h b/klippy/chelper/trapq.h index 4572ef1a..fa55faaf 100644 --- a/klippy/chelper/trapq.h +++ b/klippy/chelper/trapq.h @@ -4,7 +4,12 @@ #include "list.h" // list_node struct coord { - double x, y, z; + union { + struct { + double x, y, z; + }; + double axis[3]; + }; }; struct move { @@ -27,6 +32,7 @@ void trapq_append(struct trapq *tq, double print_time , double start_v, double cruise_v, double accel); double move_get_distance(struct move *m, double move_time); struct coord move_get_coord(struct move *m, double move_time); +double trapq_integrate(struct move *m, int axis, double start, double end); struct trapq *trapq_alloc(void); void trapq_free(struct trapq *tq); void trapq_check_sentinels(struct trapq *tq); |