i think that the following behavior would make more sense:
sin, cos, and tan should require either dimensionless or angle units as input, and provide a dimensionless output
asin, acos, atan, should require dimensionless input and provide angle output
atan2 should provide angle output, and retain its current check for the dimensionality of the two inputs being the same
if you think input unit constraints would be too much, implementing just the output unit changes would also be fine. i can make a PR for this if these changes are wanted
The following in eval.rs clones the input units for all trig functions
https://github.com/tiffany352/rink-rs/blob/4a492c64f33f51a89a685d31365042d21cb4f0ed/core/src/runtime/eval.rs#L289-L348
this results in some confusing behavior when running trig functions with units
i think that the following behavior would make more sense:
sin
,cos
, andtan
should require either dimensionless or angle units as input, and provide a dimensionless outputasin
,acos
,atan
, should require dimensionless input and provide angle outputatan2
should provide angle output, and retain its current check for the dimensionality of the two inputs being the sameif you think input unit constraints would be too much, implementing just the output unit changes would also be fine. i can make a PR for this if these changes are wanted