1math::rationalfunctions(n)           Math           math::rationalfunctions(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       math::rationalfunctions - Polynomial functions
9

SYNOPSIS

11       package require Tcl  ?8.4?
12
13       package require math::rationalfunctions  ?1.0.1?
14
15       ::math::rationalfunctions::rationalFunction num den
16
17       ::math::rationalfunctions::ratioCmd num den
18
19       ::math::rationalfunctions::evalRatio rational x
20
21       ::math::rationalfunctions::addRatio ratio1 ratio2
22
23       ::math::rationalfunctions::subRatio ratio1 ratio2
24
25       ::math::rationalfunctions::multRatio ratio1 ratio2
26
27       ::math::rationalfunctions::divRatio ratio1 ratio2
28
29       ::math::rationalfunctions::derivPolyn ratio
30
31       ::math::rationalfunctions::coeffsNumerator ratio
32
33       ::math::rationalfunctions::coeffsDenominator ratio
34
35_________________________________________________________________
36

DESCRIPTION

38       This package deals with rational functions of one variable:
39
40       ·      the  basic  arithmetic operations are extended to rational func‐
41              tions
42
43       ·      computing the derivatives of these functions
44
45       ·      evaluation through a general procedure or  via  specific  proce‐
46              dures)
47

PROCEDURES

49       The package defines the following public procedures:
50
51       ::math::rationalfunctions::rationalFunction num den
52              Return  an  (encoded) list that defines the rational function. A
53              rational function
54
55                           1 + x^3
56                 f(x) = ------------
57                        1 + 2x + x^2
58
59              can be defined via:
60
61                 set f [::math::rationalfunctions::rationalFunction [list 1 0 0 1]  [list 1 2 1]]
62
63
64              list num
65                     Coefficients of the numerator of  the  rational  function
66                     (in ascending order)
67
68
69              list den
70                     Coefficients  of the denominator of the rational function
71                     (in ascending order)
72
73
74       ::math::rationalfunctions::ratioCmd num den
75              Create a new procedure that evaluates the rational function. The
76              name  of  the function is automatically generated. Useful if you
77              need to evaluate the function many times, as the procedure  con‐
78              sists of a single [expr] command.
79
80              list num
81                     Coefficients  of  the  numerator of the rational function
82                     (in ascending order)
83
84
85              list den
86                     Coefficients of the denominator of the rational  function
87                     (in ascending order)
88
89
90       ::math::rationalfunctions::evalRatio rational x
91              Evaluate the rational function at x.
92
93              list rational
94                     The  rational  function's  definition (as returned by the
95                     rationalFunction command).  order)
96
97              float x
98                     The coordinate at which to evaluate the function
99
100
101       ::math::rationalfunctions::addRatio ratio1 ratio2
102              Return a new rational function which is the sum of the two  oth‐
103              ers.
104
105              list ratio1
106                     The first rational function operand
107
108              list ratio2
109                     The second rational function operand
110
111
112       ::math::rationalfunctions::subRatio ratio1 ratio2
113              Return  a  new  rational function which is the difference of the
114              two others.
115
116              list ratio1
117                     The first rational function operand
118
119              list ratio2
120                     The second rational function operand
121
122
123       ::math::rationalfunctions::multRatio ratio1 ratio2
124              Return a new rational function which is the product of  the  two
125              others.   If  one  of the arguments is a scalar value, the other
126              rational function is simply scaled.
127
128              list ratio1
129                     The first rational function operand or a scalar
130
131              list ratio2
132                     The second rational function operand or a scalar
133
134
135       ::math::rationalfunctions::divRatio ratio1 ratio2
136              Divide the first rational function by the second rational  func‐
137              tion and return the result. The remainder is dropped
138
139              list ratio1
140                     The first rational function operand
141
142              list ratio2
143                     The second rational function operand
144
145
146       ::math::rationalfunctions::derivPolyn ratio
147              Differentiate the rational function and return the result.
148
149              list ratio
150                     The rational function to be differentiated
151
152
153       ::math::rationalfunctions::coeffsNumerator ratio
154              Return  the  coefficients of the numerator of the rational func‐
155              tion.
156
157              list ratio
158                     The rational function to be examined
159
160
161       ::math::rationalfunctions::coeffsDenominator ratio
162              Return the coefficients of the denominator of the rational func‐
163              tion.
164
165              list ratio
166                     The rational function to be examined
167
168

REMARKS ON THE IMPLEMENTATION

170       The  implementation of the rational functions relies on the math::poly‐
171       nomials package. For further remarks  see  the  documentation  on  that
172       package.
173

BUGS, IDEAS, FEEDBACK

175       This  document,  and the package it describes, will undoubtedly contain
176       bugs and other problems.  Please report such in the  category  math  ::
177       rationalfunctions   of   the   Tcllib   SF   Trackers   [http://source
178       forge.net/tracker/?group_id=12883].  Please also report any  ideas  for
179       enhancements you may have for either package and/or documentation.
180

KEYWORDS

182       math, rational functions
183
185       Copyright (c) 2005 Arjen Markus <arjenmarkus@users.sourceforge.net>
186
187
188
189
190math                                 1.0.1          math::rationalfunctions(n)
Impressum