pkg.re/essentialkaos/ek.10@v12.41.0+incompatible/easing/examples_test.go (about)

     1  package easing
     2  
     3  // ////////////////////////////////////////////////////////////////////////////////// //
     4  //                                                                                    //
     5  //                         Copyright (c) 2022 ESSENTIAL KAOS                          //
     6  //      Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0>     //
     7  //                                                                                    //
     8  // ////////////////////////////////////////////////////////////////////////////////// //
     9  
    10  import (
    11  	"fmt"
    12  )
    13  
    14  // ////////////////////////////////////////////////////////////////////////////////// //
    15  
    16  func ExampleLinear() {
    17  	fmt.Println(Linear(5, 0, 10, 10))
    18  	// Output: 5
    19  }
    20  
    21  func ExampleQuadIn() {
    22  	fmt.Println(QuadIn(5, 0, 10, 10))
    23  	// Output: 2.5
    24  }
    25  
    26  func ExampleQuadOut() {
    27  	fmt.Println(QuadOut(5, 0, 10, 10))
    28  	// Output: 7.5
    29  }
    30  
    31  func ExampleQuadInOut() {
    32  	fmt.Println(QuadInOut(5, 0, 10, 10))
    33  	// Output: 5
    34  }
    35  
    36  func ExampleCubicIn() {
    37  	fmt.Println(CubicIn(5, 0, 10, 10))
    38  	// Output: 1.25
    39  }
    40  
    41  func ExampleCubicOut() {
    42  	fmt.Println(CubicOut(5, 0, 10, 10))
    43  	// Output: 8.75
    44  }
    45  
    46  func ExampleCubicInOut() {
    47  	fmt.Println(CubicInOut(5, 0, 10, 10))
    48  	// Output: 5
    49  }
    50  
    51  func ExampleQuintIn() {
    52  	fmt.Println(QuintIn(5, 0, 10, 10))
    53  	// Output: 0.3125
    54  }
    55  
    56  func ExampleQuintOut() {
    57  	fmt.Println(QuintOut(5, 0, 10, 10))
    58  	// Output: 9.6875
    59  }
    60  
    61  func ExampleQuintInOut() {
    62  	fmt.Println(QuintInOut(5, 0, 10, 10))
    63  	// Output: 5
    64  }
    65  
    66  func ExampleSineIn() {
    67  	fmt.Println(SineIn(5, 0, 10, 10))
    68  	// Output: 3.0978992192751917
    69  }
    70  
    71  func ExampleSineOut() {
    72  	fmt.Println(SineOut(5, 0, 10, 10))
    73  	// Output: 7.236090437019012
    74  }
    75  
    76  func ExampleSineInOut() {
    77  	fmt.Println(SineInOut(5, 0, 10, 10))
    78  	// Output: 4.999999999999999
    79  }
    80  
    81  func ExampleExpoIn() {
    82  	fmt.Println(ExpoIn(5, 0, 10, 10))
    83  	// Output: 0.3125
    84  }
    85  
    86  func ExampleExpoOut() {
    87  	fmt.Println(ExpoOut(5, 0, 10, 10))
    88  	// Output: 9.6875
    89  }
    90  
    91  func ExampleExpoInOut() {
    92  	fmt.Println(ExpoInOut(5, 0, 10, 10))
    93  	// Output: 5
    94  }
    95  
    96  func ExampleCircIn() {
    97  	fmt.Println(CircIn(5, 0, 10, 10))
    98  	// Output: 1.339745962155614
    99  }
   100  
   101  func ExampleCircOut() {
   102  	fmt.Println(CircOut(5, 0, 10, 10))
   103  	// Output: 8.660254037844386
   104  }
   105  
   106  func ExampleCircInOut() {
   107  	fmt.Println(CircInOut(5, 0, 10, 10))
   108  	// Output: 5
   109  }
   110  
   111  func ExampleElasticIn() {
   112  	fmt.Println(ElasticIn(5, 0, 10, 10))
   113  	// Output: -0.15625000000000044
   114  }
   115  
   116  func ExampleElasticOut() {
   117  	fmt.Println(ElasticOut(5, 0, 10, 10))
   118  	// Output: 10.15625
   119  }
   120  
   121  func ExampleElasticInOut() {
   122  	fmt.Println(ElasticInOut(5, 0, 10, 10))
   123  	// Output: 5
   124  }
   125  
   126  func ExampleBackIn() {
   127  	fmt.Println(BackIn(5, 0, 10, 10))
   128  	// Output: -0.9655673136318949
   129  }
   130  
   131  func ExampleBackOut() {
   132  	fmt.Println(BackOut(5, 0, 10, 10))
   133  	// Output: 10.965567313631894
   134  }
   135  
   136  func ExampleBackInOut() {
   137  	fmt.Println(BackInOut(5, 0, 10, 10))
   138  	// Output: 5
   139  }
   140  
   141  func ExampleBounceIn() {
   142  	fmt.Println(BounceIn(5, 0, 10, 10))
   143  	// Output: 2.34375
   144  }
   145  
   146  func ExampleBounceOut() {
   147  	fmt.Println(BounceOut(5, 0, 10, 10))
   148  	// Output: 7.65625
   149  }
   150  
   151  func ExampleBounceInOut() {
   152  	fmt.Println(BounceInOut(5, 0, 10, 10))
   153  	// Output: 5
   154  }