-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
We previously supported multiplication between Measurables, but specifically the inner product:
(Measured::Length(2, :cm) * Measured::Length(3, :cm)).to_s
> 6 cmThis is convenient, but not (mathematically) correct. When multiplying two measured values we should combine units from the same system, raising the exponent, and then multiplying/dividing the other units:
Measured::Length(2, :cm) * Measured::Length(3, :cm)
> 6 cm^2
Measured::Length(2, :m) * Measured::Length(0.002, :km) / Measured::Time(0.1, :seconds)
> 40 m/sThis change should not come at a performance penalty for any current use cases:
unit + unitunit.scale(scalar)unit.convert_to(:simple_unit)- etc
Metadata
Metadata
Assignees
Labels
No labels