Open
Description
Is your feature request related to a problem? Please describe.
I'm always frustrated when I have to do distance.in(distanceUnit) followed by some math and then unit.of(resultOfMyMath)
Describe the solution you'd like
The same way there is .div and .plus methods for Distance I would like a .hypot(otherDistance) method. Using the plus method at Line 59 of Distance as an example I would write it like this:
@Override
default Distance hypot(Measure<? extends DistanceUnit> other) {
return (Distance) unit().ofBaseUnits(Math.hypot(baseUnitMagnitude() + other.baseUnitMagnitude()));
}
Additional context
Here's what I'm currently using as a work around in my code:
public static Distance hypot(Distance a, Distance b) {
return a.unit().of(Math.hypot(a.magnitude(), b.magnitude()));
}