Math-SegmentedEnvelope
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Math/SegmentedEnvelope.pm view on Meta::CPAN
if ($at > $total) {
if ($self->is_fold_over && int($at/$total) % 2 == ( $t < 0 && $self->is_wrap_neg ? 0 : 1 )) { #fold
( 1 - ( ($at / $total) - int($at / $total) ) ) * $total;
} else { # wrap
( ($at / $total) - int($at / $total) ) * $total;
}
} else { $at }
};
}
sub update_current_segment {
my ($self, $i) = @_;
$i = $self->_current_segment(defined($i) ? $i : ());
$self->_level_diff($self->level($i+1) - $self->level($i));
$self->_is_neg($self->curve($i) < 0 ? 1 : 0);
$self->_is_asc($self->_level_diff < 0 || $self->_is_neg ? -1 : 1);
$self->_past_segment($i);
}
sub level {
my $self = shift;
view all matches for this distributionview release on metacpan - search on metacpan
( run in 1.226 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )