[system] / trunk / webwork / system / courseScripts / PGnumericalmacros.pl Repository:
ViewVC logotype

Diff of /trunk/webwork/system/courseScripts/PGnumericalmacros.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 22 Revision 23
33 33
34BEGIN { 34BEGIN {
35 be_strict(); 35 be_strict();
36} 36}
37sub _PGnumericalmacros_init { 37sub _PGnumericalmacros_init {
38}
39sub _PGnumericalmacros_export {
40
41 my @EXPORT = (
42 '&plot_list', '&horner', '&hermite', '&hermite_spline',
43 '&cubic_spline', '&eval_cubic_spline', '&create_cubic_spline',
44 '&javaScript_cubic_spline', '&trapezoid', '&romberg',
45 '&romberg_iter',
46 );
47 @EXPORT;
38} 48}
39 49
40sub plot_list { 50sub plot_list {
41 my($xref,$yref) = @_; 51 my($xref,$yref) = @_;
42 unless( defined($xref) && ref($xref) =~/ARRAY/ ) { 52 unless( defined($xref) && ref($xref) =~/ARRAY/ ) {
390 400
391=head3 Integration by trapezoid rule 401=head3 Integration by trapezoid rule
392 402
393=pod 403=pod
394 404
395 Useage: trapezoid(function_reference, start, end, steps=>30]); 405 Useage: trapezoid(function_reference, start, end, steps=>30 );
396 406
397Implements the trapezoid rule using 30 intervals between 'start' and 'end'. 407Implements the trapezoid rule using 30 intervals between 'start' and 'end'.
408The first three arguments are required. The final argument (number of steps)
409is optional and defaults to 30.
398 410
399=cut 411=cut
400 412
401 413
402sub trapezoid { 414sub trapezoid {

Legend:
Removed from v.22  
changed lines
  Added in v.23

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9