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

plot_list

Description
Plots a piecewise linear non-parametric curve through a sequence of points.

Syntax

$fun = plot_list([x0,y0,x1,y1,...]);
$fun = plot_list([(x0,y0),(x1,y1),...]);
$fun = plot_list(\@x_y_array);

$fun = plot_list([x0,x1,x2...], [y0,y1,y2,...]);
$fun = plot_list(\@xarray,\@yarray);

Params

Arguments are either a reference to a single array of (x,y) pairs, or references to two pairs of arrays, containing the x values and y values respectively. The x values should be strictly increasing.

Returns

A reference to a function subroutine which accepts a single x argument and returns a y value. The domain of the function is the closed interval between the lowest and highest x values

Examples

$fun = plot_list([(0,1), (1,4), (2,0) ]); # stores a reference to a piecewise linear function in $fun.
$y = &$fun(1.5); # calculates the value of the interpolating piecewise linear function at x=1.5

Notes

This macro is defined in PGnumericalmacros.pl

<| Post or View Comments |>


Prev | Next | manpages

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