I have a bunch of data to which I've assigned units using Quantity, including some angular measurements in degrees. I'd like to be able to use these measurements with trigonometric functions, but it seems that trig functions don't "know" about Quantity, so I'm forced to convert those measurements to radians and then apply the trig function to the magnitudes, like this:
x = Quantity[23.4, "AngularDegrees"]
Cos[QuantityMagnitude @ UnitConvert[x, "Radians"]]
This works, but it's slow and seems clunky, at best. Is there a more elegant (and hopefully faster) approach?
Comments
Post a Comment