Skip to content

Commit

Permalink
[Doc] Update math_module.md (#7175)
Browse files Browse the repository at this point in the history
This PR adds comments to complex arithmetics examples.
  • Loading branch information
neozhaoliang authored Jan 16, 2023
1 parent 78dc51c commit dd2c0d4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions docs/lang/articles/math/math_module.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,9 @@ You can also compute the power, logarithm, and exponential of a complex number:

@ti.kernel
def test():
x = tm.vec2(1, 1)
y = tm.cpow(x, 2)
z = tm.clog(x)
w = tm.cexp(x)
x = tm.vec2(1, 1) # complex number 1 + 1j
y = tm.cpow(x, 2) # complex number (1 + 1j)**2 = 2j
z = tm.clog(x) # complex number (0.346574 + 0.785398j)
w = tm.cexp(x) # complex number (1.468694 + 2.287355j)

```

0 comments on commit dd2c0d4

Please sign in to comment.