Re: [Numpy-discussion] numpy grant update
![](https://secure.gravatar.com/avatar/010a29141d99dad896beef506bfa3dca.jpg?s=120&d=mm&r=g)
So whilst it’s true that trigonometric functions only make sense for dimensionless quantities, you might still want to compute them for dimensional quantities for reasons of computational efficiency. Taking your example of sin(a) in a spectral density identity: log(cos(ka) + i sin(ka)) = k log(cos(a) + i sin(a)) so if you are computing the LHS for many k and a single a (i.e k the wavenumber and ka dimensionless) then you might prefer the RHS, which actually uses sin(a). Peter
![](https://secure.gravatar.com/avatar/851ff10fbb1363b7d6111ac60194cc1c.jpg?s=120&d=mm&r=g)
Hi Peter, When using units, if `a` is not angular (or dimensionless), I don't see how one could write code in which your example wouldn't fail... But I may be missing something, since for your example one would just realize that cos(ka)+i sin(ka) = exp(ika), in which case the log is just ika and one can the whole complexity... All the best, Marten On Fri, Oct 27, 2017 at 3:24 PM, Peter Creasey <p.e.creasey.00@googlemail.com> wrote:
![](https://secure.gravatar.com/avatar/851ff10fbb1363b7d6111ac60194cc1c.jpg?s=120&d=mm&r=g)
Hi Peter, When using units, if `a` is not angular (or dimensionless), I don't see how one could write code in which your example wouldn't fail... But I may be missing something, since for your example one would just realize that cos(ka)+i sin(ka) = exp(ika), in which case the log is just ika and one can the whole complexity... All the best, Marten On Fri, Oct 27, 2017 at 3:24 PM, Peter Creasey <p.e.creasey.00@googlemail.com> wrote:
participants (2)
-
Marten van Kerkwijk
-
Peter Creasey