From WeBWorK

Jump to: navigation




                $obj = new Hermit(\@x_values, \y_valuses \@yp_values);
                #get and set methods
                $ra_x_values = $obj -> ra_x(\@x_values);
                $ra_y_values = $obj -> ra_y;
                $ra_yp_values = $obj -> ra_yp;
                $obj -> initialize;           # calculates the approximation
                #get methods
                $rf_function                  = $obj -> rf_f;
                $rf_function_derivative       = $obj -> rf_fp;
                $rf_function_2nd_derivative   = $obj -> rf_fpp;
                $rh_critical_points           =$obj -> rh_critical_points
                $rh_inflection_points         =$obj -> rh_inflection_points


This module defines an object containing a Hermite spline approximation to a function. The approximation consists of a piecewise cubic polynomial which agrees with the original function and its first derivative at the node points.

This is useful for creating on the fly graphics. Care must be taken to use a small number of points spaced reasonably far apart, preferably points with alternating slopes, since this will minimize the number of extraneous critical points introduced. Too many points will introduce many small variations and a large number of extraneous critical points.

There are even more extraneous inflections points. This parameter is probably not very useful. A different approximation scheme needs to be used.