Closed andi-huber closed 5 years ago
Thank you andi-huber, the Wolfram article made me change my mind. It is elegant and makes senses mathematically (indeed Wolfram is a reference for that matter). For the user, it is quite simple, there can be a property in Unit (e.g. isDifference()) and a few additional units (e.g. CELSIUS_DIFF, FAHRENHEIT_DIFF). Of course, some quantity operations will not be allowed (e.g. adding quantity in CELSIUS and quantity in FAHRENHEIT not allowed, but adding quantity in CELSIUS_DIFF and quantity in FAHRENHEIT_DIFF allowed).
It might help the discussion on 'AbsoluteVsRelative' [1] to actually have some Java code to play around with.
Note: there are 3 TODO markers, where Indryia does things differently than Mathematica does.
[1] https://github.com/unitsofmeasurement/unit-api/issues/140
This change is