Skip to content
easing module for v
V
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
CODE_OF_CONDUCT.md
LICENSE
README.md
veasing.v
veasing_test.v

README.md

veasing

This is a pure V module that provides easing function calculations.

Install

v install jamestomasino.veasing

Usage

In your v source:

import jamestomasino.veasing as veasing

Use the animate function to apply an easing function over a range of numbers

fn main () {
  println(veasing.animate(veasing.bounce_ease_out, 0, 100, 100))
  //      easing function ^
  //                                  lower bounds ^
  //                                     upper bounds ^
  //               number of frames/length of return array ^
}

The following easing methods are available:

veasing.linear_interpolation(p f64) f64

veasing.quadratic_ease_in(p f64) f64
veasing.quadratic_ease_out(p f64) f64
veasing.quadratic_ease_in_out(p f64) f64

veasing.cubic_ease_in(p f64) f64
veasing.cubic_ease_out(p f64) f64
veasing.cubic_ease_in_out(p f64) f64

veasing.quartic_ease_in(p f64) f64
veasing.quartic_ease_out(p f64) f64
veasing.quartic_ease_in_out(p f64) f64

veasing.quintic_ease_in(p f64) f64
veasing.quintic_ease_out(p f64) f64
veasing.quintic_ease_in_out(p f64) f64

veasing.sine_ease_in(p f64) f64
veasing.sine_ease_out(p f64) f64
veasing.sine_ease_in_out(p f64) f64

veasing.circular_ease_in(p f64) f64
veasing.circular_ease_out(p f64) f64
veasing.circular_ease_in_out(p f64) f64

veasing.exponential_ease_in(p f64) f64
veasing.exponential_ease_out(p f64) f64
veasing.exponential_ease_in_out(p f64) f64

veasing.elastic_ease_in(p f64) f64
veasing.elastic_ease_out(p f64) f64
veasing.elastic_ease_in_out(p f64) f64

veasing.back_ease_in(p f64) f64
veasing.back_ease_out(p f64) f64
veasing.back_ease_in_out(p f64) f64

veasing.bounce_ease_in(p f64) f64
veasing.bounce_ease_out(p f64) f64
veasing.bounce_ease_in_out(p f64) f64

Testing

To run the tests you will need to do the following:

  1. Clone the repository somewhere
  2. Move to the parent folder of that cloned repository
  3. Run v -stats test /cloned-folder-path

Credits

Based on the works of:

License

GPL-3.0

You can’t perform that action at this time.