From: yu.dongliang <18588496441@163.com> Date: Tue, 5 Sep 2023 13:32:03 +0000 (+0800) Subject: __ses_ui_r() X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=e1fe6009c5de7ef3fa4a579576e945008fcc1b68;p=ses.git __ses_ui_r() --- 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;