UNPKG

610 Btext/coffeescriptView Raw
1### conj =====================================================================
2
3Tags
4----
5scripting, JS, internal, treenode, general concept
6
7Parameters
8----------
9z
10
11General description
12-------------------
13Returns the complex conjugate of z.
14
15###
16
17
18Eval_conj = ->
19 push(cadr(p1))
20 Eval()
21 p1 = pop()
22 push(p1)
23 if (!Find(p1, imaginaryunit)) # example: (-1)^(1/3)
24 polar()
25 conjugate()
26 clockform()
27 else
28 conjugate()
29
30
31# careful is you pass this one an expression with
32# i (instead of (-1)^(1/2)) then this doesn't work!
33conjugate = ->
34 push(imaginaryunit)
35 push(imaginaryunit)
36 negate()
37 subst()
38 Eval()