From e1fe6009c5de7ef3fa4a579576e945008fcc1b68 Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Tue, 5 Sep 2023 21:32:03 +0800 Subject: [PATCH] __ses_ui_r() --- ses_core.h | 6 ++++++ ses_step_va.c | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/ses_core.h b/ses_core.h index 62c16d1..5e1d709 100644 --- a/ses_core.h +++ b/ses_core.h @@ -36,6 +36,12 @@ struct ses_path_s double r; double jr; + double v; + double jv; + + double a; + double ja; + int type; int index; }; diff --git a/ses_step_va.c b/ses_step_va.c index 8d4577d..29b95d5 100644 --- a/ses_step_va.c +++ b/ses_step_va.c @@ -10,6 +10,14 @@ static inline void __ses_ur_i(double* a, double* ja, double v, double jv, double *ja = (jv * r - v * jr) / R; } +static inline void __ses_ui_r(double* r, double* jr, double v, double jv, double a, double ja) +{ + double R = a * a + ja * ja; + + *r = ( v * a + jv * ja) / R; + *jr = (jv * a - v * ja) / R; +} + static inline void __ses_ir_u(double* v, double* jv, double a, double ja, double r, double jr) { *v = a * r - ja * jr; -- 2.25.1