NAME

Algorithm::Easing - Calculate eased translations between two positive whole integer values over time

## with mediator

use Algorithm::Easing;
use Algorithm::Easing::Mediator;
use Algorithm::Easing::Bounce;

# this example produces traditional 'bounce' output;

my $translation_mediator = Algorithm::Easing::Mediator->new(Algorithm::Easing::Mediator::Bounce->new);

# total time for eased translation as a real positive integer value
my $d = 2.5;

# begin
my $b = 0;

# change
my $c = 0;

# time passed in seconds as a real positive integer between each frame
my $frame_time = 0.0625;

my @p = [319,0];

for(my $t = 0; $t < 2.5; $t += 0.0625) {
    $p[1] = $translation_mediator->ease_out($t,$b,$c,$d)

    # plot
    ...
}

Commonly used in animation, Penner's easing functions are beautiful translations between two positive whole integer values.

The included easing functions in Algorithm::Easing are :

Exponential
Elastic
Bounce
Linear
Cubic
Quadratic
Quartinion
Quintonion
Sinusoidal
Backdraft
Circular

For ease of use, there is an included Mediator class. The Mediator class permits the programmer to select from the spread of easing functions through a single class name.

Read of a usage example using the proper mediator :

## with mediator

use Algorithm::Easing;
use Algorithm::Easing::Mediator;
use Algorithm::Easing::Bounce;

# this example produces traditional 'bounce' output;

my $translation_mediator = Algorithm::Easing::Mediator->new(Algorithm::Easing::Bounce->new);

# total time for eased translation as a real positive integer value
my $t = 2.5;

# begin
my $b = 0;

# change
my $c = 240;

# time passed in seconds as a real positive integer between each frame
my $frame_time = 0.0625;

my @p = [319,0];

for(my $d = 0; $d < 2.5; $d += 0.0625) {
    $p[1] = $translation_mediator->ease_out($t,$b,$c,$d)

    # plot
    ...;
}
=over 2    
=item ease_none
Usage :

    Arguments : 
        t = time,
        b = begin,
        c = change,
        d = duration,
    Return :
        p = position,
        
    my $p = $obj->ease_both($t,$b,$c,$d);

This method is used for a linear translation between two positive real whole integers using a positive real integer as the parameter for time.

Arguments : 
    t = time,
    b = begin,
    c = change,
    d = duration,
Return :
    p = position,
    
my $p = $obj->ease_both($t,$b,$c,$d);

This method is used for a eased translation between two positive real whole integers as an inward tween using a positive real integer as the parameter for time.

Arguments : 
    t = time,
    b = begin,
    c = change,
    d = duration,
Return :
    p = position,
    
my $p = $obj->ease_both($t,$b,$c,$d);

This method is used for a eased translation between two positive real whole integers as an outward tween using a positive real integer as the parameter for time.

Arguments : 
    t = time,
    b = begin,
    c = change,
    d = duration,
Return :
    p = position,
    
my $p = $obj->ease_both($t,$b,$c,$d);

This method is used for a eased translation between two positive real whole integers as an inward then outward tween using a positive real integer as the parameter for time.

Jason McVeigh, <jmcveigh@outlook.com>

Copyright 2016 by Jason McVeigh

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

9 POD Errors

The following errors were encountered while parsing the POD:

Around line 16:

=back doesn't take any parameters, but you said =back =head1 SYNOPSIS

=back without =over

Around line 50:

=back doesn't take any parameters, but you said =back =head1 INTRODUCTION

=back without =over

Around line 71:

=back doesn't take any parameters, but you said =back =head1 USAGE

=back without =over

Around line 122:

=back doesn't take any parameters, but you said =back =over 2 =item ease_in Usage :

=back without =over

Around line 139:

=back doesn't take any parameters, but you said =back =over 2 =item ease_out Usage :

=back without =over

Around line 156:

=back doesn't take any parameters, but you said =back =over 2 =item ease_both Usage :

=back without =over

Around line 173:

=back doesn't take any parameters, but you said =back =head1 AUTHOR

=back without =over

Around line 178:

=back doesn't take any parameters, but you said =back =head1 COPYRIGHT AND LICENSE

=back without =over

Around line 186:

=back without =over