1
# This file is part of the UFO.
3
# This file contains definitions for functions that
4
# are extensions of the cmath library, and correspond
5
# either to functions that are in cmath, but inconvenient
6
# to access from there (e.g. z.conjugate()),
7
# or functions that are simply not defined.
11
__date__ = "22 July 2010"
12
__author__ = "claude.duhr@durham.ac.uk"
15
from object_library import all_functions, Function
18
# shortcuts for functions from cmath
21
complexconjugate = Function(name = 'complexconjugate',
23
expression = 'z.conjugate()')
26
re = Function(name = 're',
28
expression = 'z.real')
30
im = Function(name = 'im',
32
expression = 'z.imag')
34
# New functions (trigonometric)
36
sec = Function(name = 'sec',
38
expression = '1./cmath.cos(z)')
40
asec = Function(name = 'asec',
42
expression = 'cmath.acos(1./z)')
44
csc = Function(name = 'csc',
46
expression = '1./cmath.sin(z)')
48
acsc = Function(name = 'acsc',
50
expression = 'cmath.asin(1./z)')