WeBWorKdocs

sq_webwork:


Home
Current UR
courses
Visitor
page
Intro to
WeBWorK
WeBWorK 2
Twiki
WW
Community
Grant Support
& awards
Discussion
group
Problem
library
Write/modify
problems
Create &
manage course
Tutorial on
running a course
HowTos
FAQ
WeBWorK2
FAQ
Software
Download
How to
Install WW server
Feedback
Site Map
Change
preferences
Change
password





Prev | Next | manpages

trapezoid

Description
Implements the trapezoid rule. The first three arguments are required.

Syntax

$area = trapezoid($rf_func, $start, $end, %options);

Params

$rf_func refers to a subroutine of one variable defining the function.
$start is the left hand endpoint of the integral.
$end is the right hand endpoint of the integral.

Options

Option keyOption valueDefault
steps,
intervals
The number of intervals in the trapezoid approximation. 30

Returns

A number representing the definite integral

Examples

$area = trapezoid(sub { my $x=shift; $x**2;}, 0, 1, steps =>100); # overkill evaluation of x^2 on the interval from 0 to 1.

See Also

romberg

<| Post or View Comments |>


Prev | Next | manpages

Last update: Wednesday, January 10, 2007 at 10:27:28 PM.
This site maintained using Manila and Frontier software.