allwpilib icon indicating copy to clipboard operation
allwpilib copied to clipboard

Java Units: Add more cases of dimensional analysis for `times()` and `divide()`

Open bhall-ctre opened this issue 1 month ago • 3 comments

This adds/fixes some common cases of dimensional analysis for times() and divide() in the Java units library:

  • Dimensionless * U -> U
  • Dimensionless * Per<U, Dimensionless> -> U
  • Time * Velocity<U> -> U
  • Dimensionless / Velocity<U> -> Per<Time, U>
  • Dimensionless / Per<U1, U2> -> Per<U2, U1>
  • Dimensionless / Per<Time, U> -> Velocity<U>
  • U / Time -> Velocity<U>

This does not add dimensional analysis when one of the measurements is a Mult<U1, U2>.

bhall-ctre avatar Jun 03 '24 18:06 bhall-ctre