package Algorithm::Easing::Ease;

use Moo;

use constant EPSILON => 0.000001;

use namespace::clean;

sub ease_none {
    my $self = shift;
    my ($t,$b,$c,$d) = (shift,shift,shift,shift);

    return $b if $t < EPSILON;
    return $c if $d < EPSILON;

    return($c * $t / $d + $b);
}

sub pow {
    my $self = shift;
    my ($a, $b) = (shift,shift);

    return($a ** $b);
}

1;

__END__

# MAN3 POD

=head1 NAME

Algorithm::Easing::Ease - This is the base class for an ease.

=head1 INTRODUCTION

The easing functions in extending this class are :

=over
=item Exponential
=item Elastic
=item Bounce
=item Linear
=item Cubic
=item Quadratic
=item Quartinion
=item Quintonion
=item Sinusoidal
=item Backdraft
=item Circular
=back

=over
=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.

=back
=head1 AUTHOR

Jason McVeigh, <jmcveigh@outlook.com>

=head1 COPYRIGHT AND LICENSE

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.

=back
=cut