GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Try online
  • GitLab
  • GitHub

This view

  • Original page
  • New address

GeezerVison is showing urn-lang.com — math/complex | Urn

math/complex

(->polar z)

Defined at lib/math/complex.lisp:103:2

Get the magnitude and angle of complex number Z.

Example

> (first (->polar (complex 3 4)))
out = 5
> (math/deg (second (-> polar (complex 2 2))))
out = 45

(angle z)

Defined at lib/math/complex.lisp:149:2

Get the angle of complex number Z.

If you need the magnitude as well, one should probably use ->polar.

Example

> (math/floor (math/deg (angle (complex 2 2))))
out = 45

(complex r i)

Defined at lib/math/complex.lisp:16:2

Represents a complex number, formed of a real and imaginary part.

(conjugate z)

Defined at lib/math/complex.lisp:91:2

Get the complex conjugate of Z.

Example

> (conjugate (complex 1 2))
out = 1-2i

(imaginary complex)

Defined at lib/math/complex.lisp:16:2

The imaginary part of this complex number.

(magnitude z)

Defined at lib/math/complex.lisp:135:2

Get the magnitude of complex number Z.

If you need the angle as well, one should probably use ->polar.

Example

> (magnitude (complex 3 4))
out = 5

(polar-> magnitude angle)

Defined at lib/math/complex.lisp:122:2

Create a complex number from the given MAGNITUDE and ANGLE.

Example

> (polar-> (math/sqrt 2) (math/rad 45))
out = 1+1i

(real complex)

Defined at lib/math/complex.lisp:16:2

The real part of this complex number.

Undocumented symbols

  • $complex Defined at lib/math/complex.lisp:16:2
  • (complex? complex) Defined at lib/math/complex.lisp:16:2

Tutorial

  • An Introduction to Urn
  • Guess the number
  • Finding errors
  • Macros and more
  • How do I do X?
  • Integrating with Lua
  • The compiler API

Reference

  • Syntax
  • Special forms
  • CLI
  • The REPL

Recent News

  • Version 0.7.0 released
  • Version 0.6.1 released
  • Version 0.6.0 released

All libraries

  • Symbol index
  • compiler/helpers
  • compiler
  • compiler/nodes
  • compiler/optimise
  • compiler/pass
  • compiler/pattern
  • compiler/resolve
  • control/comparison
  • control/prompt
  • control/setq
  • core/base
  • core/binders
  • core/demand
  • core/list
  • core/match
  • core/method
  • core/prelude
  • core/string
  • core/symbol
  • core/table
  • core/type
  • data/alist
  • data/bitset
  • data/format
  • data/function
  • data/graph
  • data/set
  • data/struct
  • io/argparse
  • io/foreign
  • io
  • io/term
  • lua/basic
  • lua/bit32
  • lua/coroutine
  • lua/debug
  • lua/io
  • lua/math
  • lua/os
  • lua/package
  • lua/string
  • lua/table
  • lua/utf8
  • luajit/bit
  • luajit/ffi
  • luajit/jit
  • math/bignum
  • math/bit32
  • math/complex
  • math
  • math/matrix
  • math/numerics
  • math/rational
  • math/vector
  • prelude
  • test/assert
  • test/check
  • test
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.