Class | Dobjects::Function |
In: |
split/Dvector/dvector.c
split/Function/lib/Function_extras.rb |
Parent: | Object |
Function is a class that embeds two Dvectors, one for X data and one for Y data. It provides
And getting bigger everyday…
Computes spline data and caches it inside the object. Both X and Y vectors are cleared (see Dvector#clear) to make sure the cache is kept up-to-date. If the function is not sorted, sorts it.
Computes the derivative of the Function and returns it as a new Function. The newly created function shares the X vector with the previous one.
: Returns the value of the integral of the function between the two indexes given, or over the whole function if no indexes are specified.
Computes interpolated values of the data contained in f and returns a Function object holding both x_values and the computed Y values. x_values will be sorted if necessary.
With the second form, specify only the number of points, and the function will construct the appropriate vector with equally spaced points within the function range.
Returns an interpolant that can be fed to Special_Paths#append_interpolant_to_path to make nice splines.
Can be used this way:
f = Function.new(x,y) t.append_interpolant_to_path(f.make_interpolant) t.stroke
Splits the function into strictly monotonic sub-functions. Returns the array of the subfunctions. The returned values are necessarily new values.