Hacker News new | ask | show | jobs
by sharkdp 945 days ago
> As a physicist, if you ever see units on the parameter to a trigonmetric function, you can be fairly certain something is wrong.

Exactly. Which is why trigonometric functions in Numbat have the signature

  cos(x: Scalar) -> Scalar
and only take quantities as arguments that are implicitly convertible to a scalar, like 'cos(pi / 3)', 'cos(30 deg)' or 'cos(0.5 turn)'.

Whether or not angles should be considered dimensionless is actually a matter of academic dispute. If you want to know more, take a look at https://github.com/sharkdp/numbat/pull/167 and the references therein.