-
Big thanks for the awesome calculator! I searched quite a bit and kalker looks almost ideal for alternating current calculations where complex numbers are used. Is this already possible and if so could you give us some examples? If not, can this be realized as a function? Thanks again for your engagement in this great software. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Okay I tried further and found some hidden gems! If x is a complex number like x=1+2i I can use following built in functions.
What I still don't know is how I could implement a function which returns the polar form of with just one call. I tried this, but my rust knowledge is unfortunately too poor:
I also tried to put these functions to the default.kalker file on macOS via vi ~/Library/Application\ Support/kalker/default.kalker with this content (pi only defined because I thought it was not defined at this point) pi=3.14159265359 I ran into further problems
So I would appreciate further tipps to make it smooth. Thx again for everything you created so far! PS: I wanted to write about complex numbers in detail so that other users can also benefit from it. |
Beta Was this translation helpful? Give feedback.
Hello! If you want to return two values, you can do that by doing something like
(abs(x), arg(x))
(wrapping them in parenthesis). Then you can access an inner value with the syntaxvalue[[i]]
orvar_i
, for example:As for the other issue, there seems to be a problem in kalker with having function parameters with several letters (eg.
phirad
), but replacing it withp
makes it work for me (this is something I'll have to fix in the future, but it is probably only an issue with function parameters, not regular variables).cart(A, p) = A*cos(p)+A*i*sin(p)
It looks like you placed
default.kalker
in the right folder,…