11 lines
323 B
Common Lisp
11 lines
323 B
Common Lisp
(define a 42+666i) → a
|
|
(define b 1+i) → b
|
|
(- a) → -42-666i ; negate
|
|
(+ a b) → 43+667i ; add
|
|
(* a b) → -624+708i ; multiply
|
|
(/ b) → 0.5-0.5i ; invert
|
|
(conjugate b) → 1-i
|
|
(angle b) → 0.7853981633974483 ; = PI/4
|
|
(magnitude b) → 1.4142135623730951 ; = sqrt(2)
|
|
(exp (* I PI)) → -1+0i ; Euler = e^(I*PI) = -1
|