feat(units): typed angular Δt helpers (MulDt/DivDt) #38

Merged
patman merged 1 commit from patman/uom-angular-helpers into main 2026-07-09 23:11:23 +00:00
Owner

What this does

Adds typed angular Δt helpers so the rotary derivative chain composes cleanly in the dim currency.

uom tags angular quantities with AngleKind, which the bare *// operators drop — so Angle / Time does not directly yield AngularVelocity and every step of the angular jerk→accel→vel→pos chain otherwise needs a hand-written .into() (documented in #37). This PR wraps that:

  • MulDt::mul_dt — integrate one step up: AngularJerk → AngularAcceleration → AngularVelocity → Angle.
  • DivDt::div_dt — differentiate one step down: Angle → AngularVelocity → AngularAcceleration → AngularJerk.

Extension traits on the dim currency types, each encapsulating the .into(). These are the per-step building blocks the jerk-constant motion integrator composes. World/base frame, per project convention.

Stack position

PR 3 of 3, based on #37 (uom two-layer integration). #37 is based on #36 (wait-timeout fix). Merge order: #36#37#38.

Verification

buck2 test //common:common-tests89 passed (3 new: one-step integrate, one-step differentiate, and a full jerk→angle→jerk round-trip).

Review focus

  • The (self * dt).into() / (self / dt).into() bodies — confirm the AngleKind re-application is correct for each step and the Output associated types match the derivative chain.
  • Whether mul_dt/div_dt are the right surface, or you want named per-pair methods.
## What this does Adds typed angular Δt helpers so the rotary derivative chain composes cleanly in the `dim` currency. uom tags angular quantities with `AngleKind`, which the bare `*`/`/` operators drop — so `Angle / Time` does not directly yield `AngularVelocity` and every step of the angular jerk→accel→vel→pos chain otherwise needs a hand-written `.into()` (documented in #37). This PR wraps that: - `MulDt::mul_dt` — integrate one step up: `AngularJerk → AngularAcceleration → AngularVelocity → Angle`. - `DivDt::div_dt` — differentiate one step down: `Angle → AngularVelocity → AngularAcceleration → AngularJerk`. Extension traits on the `dim` currency types, each encapsulating the `.into()`. These are the per-step building blocks the jerk-constant motion integrator composes. World/base frame, per project convention. ## Stack position PR 3 of 3, based on #37 (uom two-layer integration). #37 is based on #36 (wait-timeout fix). Merge order: #36 → #37 → #38. ## Verification `buck2 test //common:common-tests` → **89 passed** (3 new: one-step integrate, one-step differentiate, and a full jerk→angle→jerk round-trip). ## Review focus - The `(self * dt).into()` / `(self / dt).into()` bodies — confirm the `AngleKind` re-application is correct for each step and the `Output` associated types match the derivative chain. - Whether `mul_dt`/`div_dt` are the right surface, or you want named per-pair methods.
uom tags the angular quantities with AngleKind, which the bare * and /
operators drop — so Angle / Time does not directly yield AngularVelocity
and the rotary derivative chain needs an explicit .into() per step.

Add MulDt::mul_dt (integrate one step: AngularJerk→…→Angle) and
DivDt::div_dt (differentiate one step: Angle→…→AngularJerk) extension
traits on the dim currency types, each wrapping the required .into(), so
the angular chain composes as cleanly as the translational one. These are
the per-step building blocks the jerk-constant motion integrator composes.

Co-authored-by: patman-assist <patrick-ai@kgroo.co>
patman changed target branch from patman/uom-units to main 2026-07-09 23:11:20 +00:00
patman merged commit febcf0fdfd into main 2026-07-09 23:11:23 +00:00
Sign in to join this conversation.
No description provided.