NAME

Math::Function::Interpolator - Interpolation made easy

SYNOPSIS

use Math::Function::Interpolator;

my $interpolator = Math::Function::Interpolator->new(
    points => {1=>2,2=>3,3=>4}
);

$interpolator->linear(2.5);

$interpolator->quadratic(2.5);

$interpolator->cubic(2.5);

DESCRIPTION

Math::Function::Interpolator helps you to do the interpolation calculation with linear, quadratic and cubic methods.

1. Linear method (needs more than 1 data point) 1. Quadratic method (needs more than 2 data points) 1. Cubic method, it's a Cubic Spline method (needs more than 4 data points)

FIELDS

points (REQUIRED)

HashRef of points for interpolations

METHODS

new

New instance method

points

points

linear

This method do the linear interpolation. It solves for point_y linearly given point_x and an array of points. This method needs more than 1 data point.

quadratic

This method do the quadratic interpolation. It solves the interpolated_y value given point_x with 3 data points. This method needs more than 2 data point.

cubic

This method do the cubic interpolation. It solves the interpolated_y given point_x and a minimum of 5 data points. This method needs more than 4 data point.

closest_three_points

Returns the the closest three points to the sought point.
The third point is chosen based on the point which is closer to mid point

AUTHOR

Binary.com, <perl at binary.com>

BUGS

Please report any bugs or feature requests to bug-math-function-interpolator at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Math-Function-Interpolator. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Math::Function::Interpolator

You can also look for information at:

ACKNOWLEDGEMENTS